Deal with 0 length HTTP data write case

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

View File

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