diff --git a/include/aws/http/http.h b/include/aws/http/http.h index 70cc04e10..bce1db15c 100644 --- a/include/aws/http/http.h +++ b/include/aws/http/http.h @@ -50,6 +50,7 @@ enum aws_http_errors { AWS_ERROR_HTTP_PROXY_STRATEGY_TOKEN_RETRIEVAL_FAILURE, AWS_ERROR_HTTP_PROXY_CONNECT_FAILED_RETRYABLE, AWS_ERROR_HTTP_PROTOCOL_SWITCH_FAILURE, + AWS_ERROR_HTTP_MAX_CONCURRENT_STREAMS_EXCEEDED, AWS_ERROR_HTTP_END_RANGE = AWS_ERROR_ENUM_END_RANGE(AWS_C_HTTP_PACKAGE_ID) }; diff --git a/source/h2_connection.c b/source/h2_connection.c index 2715ab487..b8a8cca46 100644 --- a/source/h2_connection.c +++ b/source/h2_connection.c @@ -1904,6 +1904,7 @@ static void s_move_stream_to_thread( uint32_t max_concurrent_streams = connection->thread_data.settings_peer[AWS_HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS]; if (aws_hash_table_get_entry_count(&connection->thread_data.active_streams_map) >= max_concurrent_streams) { AWS_H2_STREAM_LOG(ERROR, stream, "Failed activating stream, max concurrent streams are reached"); + aws_raise_error(AWS_ERROR_HTTP_MAX_CONCURRENT_STREAMS_EXCEEDED); goto error; } @@ -2217,6 +2218,11 @@ static void s_connection_update_window(struct aws_http_connection *connection_ba aws_h2_frame_destroy(connection_window_update_frame); return; } + CONNECTION_LOGF( + TRACE, + connection, + "User requested to update the HTTP/2 connection's flow-control windows by %" PRIu32 ".", + increment_size); return; overflow: /* Shutdown the connection as overflow detected */ diff --git a/source/h2_stream.c b/source/h2_stream.c index 10415648c..e325320c5 100644 --- a/source/h2_stream.c +++ b/source/h2_stream.c @@ -454,6 +454,12 @@ static int s_stream_reset_stream(struct aws_http_stream *stream_base, uint32_t h .h2_code = http2_error, }; + AWS_LOGF_TRACE( + AWS_LS_HTTP_STREAM, + "id=%p: User requested RST_STREAM with error code %s (0x%x)", + (void *)stream_base, + aws_http2_error_code_to_str(http2_error), + http2_error); return s_stream_reset_stream_internal(stream_base, stream_error); } diff --git a/source/http.c b/source/http.c index 528a6c9b6..41b8f9fcf 100644 --- a/source/http.c +++ b/source/http.c @@ -473,6 +473,8 @@ const char *aws_http_status_text(int status_code) { return "Not Extended"; case AWS_HTTP_STATUS_CODE_511_NETWORK_AUTHENTICATION_REQUIRED: return "Network Authentication Required"; + case AWS_ERROR_HTTP_MAX_CONCURRENT_STREAMS_EXCEEDED: + return "Max concurrent stream reached"; default: return ""; }