client: Add missing error handling
@@ -1378,6 +1378,13 @@ int Client::write_streams() {
for (;;) {
auto nwrite = ngtcp2_conn_write_pkt(conn_, &path.path, sendbuf_.wpos(),
max_pktlen_, util::timestamp(loop_));
+ if (nwrite < 0) {
+ std::cerr << "ngtcp2_conn_write_pkt: " << ngtcp2_strerror(nwrite)
+ << std::endl;
+ last_error_ = quicErrorTransport(nwrite);
+ disconnect();
+ return -1;
+ }
if (nwrite == 0) {
break;
}
