Fix assertion failure
Fix assertion failure which occurs when CWND is filled up with
Handshake probe packet and Short packet in the first call of
ngtcp2_conn_writev_stream with NGTCP2_WRITE_STREAM_FLAG_MORE flag set.
The next ngtcp2_conn_writev_stream gets assertion failure.
@@ -8205,10 +8205,6 @@ ngtcp2_ssize ngtcp2_conn_writev_stream(ngtcp2_conn *conn, ngtcp2_path *path,
}
}
- if (!conn->pktns.rtb.probe_pkt_left && conn_cwnd_is_zero(conn)) {
- destlen = 0;
- assert(!ppe_pending);
- } else {
if (ppe_pending) {
res = conn->pkt.hs_spktlen;
conn->pkt.hs_spktlen = 0;
@@ -8217,15 +8213,14 @@ ngtcp2_ssize ngtcp2_conn_writev_stream(ngtcp2_conn *conn, ngtcp2_path *path,
nwrite = conn_write_pkt(conn, dest, destlen, pdatalen, NGTCP2_PKT_SHORT,
strm, fin, datav, datavcnt, wflags, ts);
goto fin;
- }
-
- if (conn->pv) {
+ } else if (!conn->pktns.rtb.probe_pkt_left && conn_cwnd_is_zero(conn)) {
+ destlen = 0;
+ } else if (conn->pv) {
nwrite = conn_write_path_challenge(conn, path, dest, destlen, ts);
if (nwrite) {
goto fin;
}
}
- }
if (res == 0) {
if (conn_handshake_remnants_left(conn)) {
