From 8d89a8dcb029251305d0dfb3f245b87be2339adb Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 4 Apr 2020 16:28:38 +0900 Subject: [PATCH] Assert ndatalen --- src/h2load_quic.cc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/h2load_quic.cc b/src/h2load_quic.cc index 86b6f074..f515f8c7 100644 --- a/src/h2load_quic.cc +++ b/src/h2load_quic.cc @@ -645,10 +645,7 @@ int Client::write_quic() { switch (nwrite) { case NGTCP2_ERR_STREAM_DATA_BLOCKED: case NGTCP2_ERR_STREAM_SHUT_WR: - if (nwrite == NGTCP2_ERR_STREAM_DATA_BLOCKED && - ngtcp2_conn_get_max_data_left(quic.conn) == 0) { - return 0; - } + assert(ndatalen == -1); if (s->block_stream(stream_id) != 0) { return -1; @@ -666,18 +663,14 @@ int Client::write_quic() { return -1; } + assert(ndatalen == -1); + quic_restart_pkt_timer(); if (nwrite == 0) { return 0; } - if (ndatalen >= 0) { - if (s->add_write_offset(stream_id, ndatalen) != 0) { - return -1; - } - } - write_udp(reinterpret_cast(ps.path.remote.addr), ps.path.remote.addrlen, buf.data(), nwrite); }