Skip to content

Commit

Permalink
Respect SETTINGS_HEADER_TABLE_SIZE http2 setting (#4635)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft authored and matyhtf committed Mar 2, 2022
1 parent 57d0859 commit 76744cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext-src/swoole_http2_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static ssize_t http2_server_build_trailer(HttpContext *ctx, uchar *buffer) {
nghttp2_hd_deflater *deflater = client->deflater;

if (!deflater) {
int ret = nghttp2_hd_deflate_new2(&deflater, SW_HTTP2_DEFAULT_HEADER_TABLE_SIZE, php_nghttp2_mem());
int ret = nghttp2_hd_deflate_new2(&deflater, client->remote_settings.header_table_size, php_nghttp2_mem());
if (ret != 0) {
swoole_warning("nghttp2_hd_deflate_new2() failed with error: %s", nghttp2_strerror(ret));
return -1;
Expand Down Expand Up @@ -370,7 +370,7 @@ static ssize_t http2_server_build_header(HttpContext *ctx, uchar *buffer, size_t
Http2Session *client = http2_sessions[ctx->fd];
nghttp2_hd_deflater *deflater = client->deflater;
if (!deflater) {
ret = nghttp2_hd_deflate_new2(&deflater, client->local_settings.header_table_size, php_nghttp2_mem());
ret = nghttp2_hd_deflate_new2(&deflater, client->remote_settings.header_table_size, php_nghttp2_mem());
if (ret != 0) {
swoole_warning("nghttp2_hd_deflate_new2() failed with error: %s", nghttp2_strerror(ret));
return -1;
Expand Down

0 comments on commit 76744cb

Please sign in to comment.