diff --git a/examples/libevent-client.c b/examples/libevent-client.c index cd5811b5..8d0b7273 100644 --- a/examples/libevent-client.c +++ b/examples/libevent-client.c @@ -287,7 +287,7 @@ static int on_stream_close_callback(nghttp2_session *session, int32_t stream_id, int rv; if (session_data->stream_data->stream_id == stream_id) { - fprintf(stderr, "Stream %d closed with error_code=%d\n", stream_id, + fprintf(stderr, "Stream %d closed with error_code=%u\n", stream_id, error_code); rv = nghttp2_session_terminate_session(session, NGHTTP2_NO_ERROR); if (rv != 0) { diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index 6282b852..f1071623 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -2281,10 +2281,6 @@ ssize_t nghttp2_hd_decode_length(uint32_t *res, size_t *shift_ptr, int *fin, return decode_length(res, shift_ptr, fin, initial, shift, in, last, prefix); } -static size_t hd_get_num_table_entries(nghttp2_hd_context *context) { - return context->hd_table.len + NGHTTP2_STATIC_TABLE_LENGTH; -} - static const nghttp2_nv *hd_get_table_entry(nghttp2_hd_context *context, size_t idx) { if (idx == 0) { @@ -2301,7 +2297,7 @@ static const nghttp2_nv *hd_get_table_entry(nghttp2_hd_context *context, } size_t nghttp2_hd_deflate_get_num_table_entries(nghttp2_hd_deflater *deflater) { - return hd_get_num_table_entries(&deflater->ctx); + return get_max_index(&deflater->ctx); } const nghttp2_nv * @@ -2320,7 +2316,7 @@ nghttp2_hd_deflate_get_max_dynamic_table_size(nghttp2_hd_deflater *deflater) { } size_t nghttp2_hd_inflate_get_num_table_entries(nghttp2_hd_inflater *inflater) { - return hd_get_num_table_entries(&inflater->ctx); + return get_max_index(&inflater->ctx); } const nghttp2_nv * diff --git a/lib/nghttp2_submit.c b/lib/nghttp2_submit.c index cf9a7c0c..07656926 100644 --- a/lib/nghttp2_submit.c +++ b/lib/nghttp2_submit.c @@ -365,7 +365,7 @@ int32_t nghttp2_submit_push_promise(nghttp2_session *session, uint8_t flags _U_, return promised_stream_id; } -int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags, +int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags _U_, int32_t stream_id, int32_t window_size_increment) { int rv; @@ -373,7 +373,6 @@ int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags, if (window_size_increment == 0) { return 0; } - flags = 0; if (stream_id == 0) { rv = nghttp2_adjust_local_window_size( &session->local_window_size, &session->recv_window_size, @@ -404,14 +403,14 @@ int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags, nghttp2_max(0, stream->consumed_size - window_size_increment); } - return nghttp2_session_add_window_update(session, flags, stream_id, + return nghttp2_session_add_window_update(session, 0, stream_id, window_size_increment); } return 0; } int nghttp2_session_set_local_window_size(nghttp2_session *session, - uint8_t flags, int32_t stream_id, + uint8_t flags _U_, int32_t stream_id, int32_t window_size) { int32_t window_size_increment; nghttp2_stream *stream; @@ -421,8 +420,6 @@ int nghttp2_session_set_local_window_size(nghttp2_session *session, return NGHTTP2_ERR_INVALID_ARGUMENT; } - flags = 0; - if (stream_id == 0) { window_size_increment = window_size - session->local_window_size; @@ -472,7 +469,7 @@ int nghttp2_session_set_local_window_size(nghttp2_session *session, } if (window_size_increment > 0) { - return nghttp2_session_add_window_update(session, flags, stream_id, + return nghttp2_session_add_window_update(session, 0, stream_id, window_size_increment); }