Assert ndatalen

This commit is contained in:
Tatsuhiro Tsujikawa 2020-04-04 16:28:38 +09:00
parent a1e88ad809
commit 39e6588fd5
1 changed files with 3 additions and 10 deletions

View File

@ -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<sockaddr *>(ps.path.remote.addr),
ps.path.remote.addrlen, buf.data(), nwrite);
}