From 2ca1ba9f72fd1ae469d7734f8fc50f0f96a01901 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 25 Jan 2021 22:30:30 +0900 Subject: [PATCH] Deal with 0 length HTTP data write case --- src/h2load_quic.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/h2load_quic.cc b/src/h2load_quic.cc index 86c85a4f..c2d3f531 100644 --- a/src/h2load_quic.cc +++ b/src/h2load_quic.cc @@ -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; }