Skip to content

Commit

Permalink
Don't filter HTTP/2 options
Browse files Browse the repository at this point in the history
It's not a big gain and causes issues when forgetting to update
the list. Maybe it can be added back again at a later time.
  • Loading branch information
essen committed Oct 1, 2019
1 parent 7f0978d commit 7d70e77
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/cow_http2_machine.erl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ init(client, Opts) ->
NextSettings = settings_init(Opts),
client_preface(#http2_machine{
mode=client,
opts=only_keep_relevant_opts(Opts),
opts=Opts,
preface_timer=start_timer(preface_timeout, Opts),
settings_timer=start_timer(settings_timeout, Opts),
next_settings=NextSettings,
Expand All @@ -201,22 +201,13 @@ init(server, Opts) ->
NextSettings = settings_init(Opts),
common_preface(#http2_machine{
mode=server,
opts=only_keep_relevant_opts(Opts),
opts=Opts,
preface_timer=start_timer(preface_timeout, Opts),
settings_timer=start_timer(settings_timeout, Opts),
next_settings=NextSettings,
local_streamid=2
}).

%% We remove the options that are part of SETTINGS or that are not known.
only_keep_relevant_opts(Opts) ->
maps:with([
initial_connection_window_size,
max_encode_table_size,
max_frame_size_sent,
settings_timeout
], Opts).

start_timer(Name, Opts) ->
case maps:get(Name, Opts, 5000) of
infinity -> undefined;
Expand Down

0 comments on commit 7d70e77

Please sign in to comment.