From 2722119776f3053248d0ac2fdafde9e1ef69c1a4 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 12 Feb 2020 11:22:19 +0900 Subject: [PATCH] Handle stream limit increment --- src/h2load_http3_session.cc | 16 ++++++++++++++-- third-party/neverbleed | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/h2load_http3_session.cc b/src/h2load_http3_session.cc index 6a3378bf..aac8df45 100644 --- a/src/h2load_http3_session.cc +++ b/src/h2load_http3_session.cc @@ -113,6 +113,10 @@ int stream_close(nghttp3_conn *conn, int64_t stream_id, uint64_t app_error_code, } // namespace int Http3Session::stream_close(int64_t stream_id, uint64_t app_error_code) { + if (!ngtcp2_is_bidi_stream(stream_id)) { + assert(!ngtcp2_conn_is_local_stream(client_->quic.conn, stream_id)); + ngtcp2_conn_extend_max_streams_uni(client_->quic.conn, 1); + } client_->on_stream_close(stream_id, app_error_code == NGHTTP3_H3_NO_ERROR); return 0; } @@ -208,10 +212,18 @@ int Http3Session::send_stop_sending(int64_t stream_id, int Http3Session::close_stream(int64_t stream_id, uint64_t app_error_code) { auto rv = nghttp3_conn_close_stream(conn_, stream_id, app_error_code); - if (rv != 0) { + switch (rv) { + case 0: + return 0; + case NGHTTP3_ERR_STREAM_NOT_FOUND: + if (!ngtcp2_is_bidi_stream(stream_id)) { + assert(!ngtcp2_conn_is_local_stream(client_->quic.conn, stream_id)); + ngtcp2_conn_extend_max_streams_uni(client_->quic.conn, 1); + } + return 0; + default: return -1; } - return 0; } int Http3Session::reset_stream(int64_t stream_id) { diff --git a/third-party/neverbleed b/third-party/neverbleed index 5cf5da80..b967ca05 160000 --- a/third-party/neverbleed +++ b/third-party/neverbleed @@ -1 +1 @@ -Subproject commit 5cf5da80b715223d2614374aec40f2663dc68d6a +Subproject commit b967ca054f48a36f82d8fcdd32e54ec5144f2751