Deal with 0 length HTTP data write case

This commit is contained in:
Tatsuhiro Tsujikawa 2021-01-25 22:30:30 +09:00
parent 8affef1061
commit 2ca1ba9f72
1 changed files with 2 additions and 2 deletions

View File

@ -584,7 +584,7 @@ int Client::write_quic() {
}
continue;
case NGTCP2_ERR_WRITE_MORE:
assert(ndatalen > 0);
assert(ndatalen >= 0);
if (s->add_write_offset(stream_id, ndatalen) != 0) {
return -1;
}
@ -593,7 +593,7 @@ int Client::write_quic() {
quic.last_error = quic::err_transport(nwrite);
return -1;
} else if (ndatalen > 0 && s->add_write_offset(stream_id, ndatalen) != 0) {
} else if (ndatalen >= 0 && s->add_write_offset(stream_id, ndatalen) != 0) {
return -1;
}