From 6418a865046b7f7536c813bcdfcc64e54255d8dc Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 25 Jul 2022 23:09:33 +0900 Subject: [PATCH] Ignore nghttp3 errors which can be ignored --- src/h2load_http3_session.cc | 22 ++++------------------ src/h2load_http3_session.h | 4 ++-- src/h2load_quic.cc | 8 ++------ src/shrpx_http3_upstream.cc | 20 ++------------------ 4 files changed, 10 insertions(+), 44 deletions(-) diff --git a/src/h2load_http3_session.cc b/src/h2load_http3_session.cc index 0e87573d..7c2af605 100644 --- a/src/h2load_http3_session.cc +++ b/src/h2load_http3_session.cc @@ -391,26 +391,12 @@ ssize_t Http3Session::write_stream(int64_t &stream_id, int &fin, return sveccnt; } -int Http3Session::block_stream(int64_t stream_id) { - auto rv = nghttp3_conn_block_stream(conn_, stream_id); - if (rv != 0) { - ngtcp2_connection_close_error_set_application_error( - &client_->quic.last_error, nghttp3_err_infer_quic_app_error_code(rv), - nullptr, 0); - return -1; - } - return 0; +void Http3Session::block_stream(int64_t stream_id) { + nghttp3_conn_block_stream(conn_, stream_id); } -int Http3Session::shutdown_stream_write(int64_t stream_id) { - auto rv = nghttp3_conn_shutdown_stream_write(conn_, stream_id); - if (rv != 0) { - ngtcp2_connection_close_error_set_application_error( - &client_->quic.last_error, nghttp3_err_infer_quic_app_error_code(rv), - nullptr, 0); - return -1; - } - return 0; +void Http3Session::shutdown_stream_write(int64_t stream_id) { + nghttp3_conn_shutdown_stream_write(conn_, stream_id); } int Http3Session::add_write_offset(int64_t stream_id, size_t ndatalen) { diff --git a/src/h2load_http3_session.h b/src/h2load_http3_session.h index cdd194dd..82adbae5 100644 --- a/src/h2load_http3_session.h +++ b/src/h2load_http3_session.h @@ -62,8 +62,8 @@ public: size_t datalen); ssize_t write_stream(int64_t &stream_id, int &fin, nghttp3_vec *vec, size_t veccnt); - int block_stream(int64_t stream_id); - int shutdown_stream_write(int64_t stream_id); + void block_stream(int64_t stream_id); + void shutdown_stream_write(int64_t stream_id); int add_write_offset(int64_t stream_id, size_t ndatalen); int add_ack_offset(int64_t stream_id, size_t datalen); diff --git a/src/h2load_quic.cc b/src/h2load_quic.cc index 88e2daa9..e9b98e4e 100644 --- a/src/h2load_quic.cc +++ b/src/h2load_quic.cc @@ -637,15 +637,11 @@ int Client::write_quic() { switch (nwrite) { case NGTCP2_ERR_STREAM_DATA_BLOCKED: assert(ndatalen == -1); - if (s->block_stream(stream_id) != 0) { - return -1; - } + s->block_stream(stream_id); continue; case NGTCP2_ERR_STREAM_SHUT_WR: assert(ndatalen == -1); - if (s->shutdown_stream_write(stream_id) != 0) { - return -1; - } + s->shutdown_stream_write(stream_id); continue; case NGTCP2_ERR_WRITE_MORE: assert(ndatalen >= 0); diff --git a/src/shrpx_http3_upstream.cc b/src/shrpx_http3_upstream.cc index b7f3edf7..d4045ddd 100644 --- a/src/shrpx_http3_upstream.cc +++ b/src/shrpx_http3_upstream.cc @@ -798,27 +798,11 @@ int Http3Upstream::write_streams() { switch (nwrite) { case NGTCP2_ERR_STREAM_DATA_BLOCKED: assert(ndatalen == -1); - rv = nghttp3_conn_block_stream(httpconn_, stream_id); - if (rv != 0) { - ULOG(ERROR, this) - << "nghttp3_conn_block_stream: " << nghttp3_strerror(rv); - ngtcp2_connection_close_error_set_application_error( - &last_error_, nghttp3_err_infer_quic_app_error_code(rv), nullptr, - 0); - return handle_error(); - } + nghttp3_conn_block_stream(httpconn_, stream_id); continue; case NGTCP2_ERR_STREAM_SHUT_WR: assert(ndatalen == -1); - rv = nghttp3_conn_shutdown_stream_write(httpconn_, stream_id); - if (rv != 0) { - ULOG(ERROR, this) - << "nghttp3_conn_shutdown_stream_write: " << nghttp3_strerror(rv); - ngtcp2_connection_close_error_set_application_error( - &last_error_, nghttp3_err_infer_quic_app_error_code(rv), nullptr, - 0); - return handle_error(); - } + nghttp3_conn_shutdown_stream_write(httpconn_, stream_id); continue; case NGTCP2_ERR_WRITE_MORE: assert(ndatalen >= 0);