0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00

Add options to control h2's SETTINGS_HEADER_TABLE_SIZE

This commit is contained in:
Loïc Hoguin 2018-04-25 16:55:52 +02:00
parent bc79529b4d
commit 8f4adf437c
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
4 changed files with 147 additions and 16 deletions

View file

@ -78,7 +78,10 @@ reject_handshake_when_disabled(Config0) ->
}, Config0),
%% Connect to server and confirm that SETTINGS_ENABLE_CONNECT_PROTOCOL = 0.
{ok, Socket, Settings} = do_handshake(Config),
#{enable_connect_protocol := false} = Settings,
case Settings of
#{enable_connect_protocol := false} -> ok;
_ when map_size(Settings) =:= 0 -> ok
end,
%% Send a CONNECT :protocol request to upgrade the stream to Websocket.
{ReqHeadersBlock, _} = cow_hpack:encode([
{<<":method">>, <<"CONNECT">>},
@ -102,7 +105,10 @@ reject_handshake_disabled_by_default(Config0) ->
}, Config0),
%% Connect to server and confirm that SETTINGS_ENABLE_CONNECT_PROTOCOL = 0.
{ok, Socket, Settings} = do_handshake(Config),
#{enable_connect_protocol := false} = Settings,
case Settings of
#{enable_connect_protocol := false} -> ok;
_ when map_size(Settings) =:= 0 -> ok
end,
%% Send a CONNECT :protocol request to upgrade the stream to Websocket.
{ReqHeadersBlock, _} = cow_hpack:encode([
{<<":method">>, <<"CONNECT">>},