aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gun.erl')
-rw-r--r--src/gun.erl8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/gun.erl b/src/gun.erl
index 5a7750b..5bf37fb 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -1389,12 +1389,8 @@ status(State, NewStatus) ->
State#state{status=NewStatus}.
keepalive_timeout(State=#state{opts=Opts, protocol=Protocol}) ->
- {ProtoOptsKey, Default} = case Protocol of
- gun_http -> {http_opts, infinity};
- gun_http2 -> {http2_opts, 5000}
- end,
- ProtoOpts = maps:get(ProtoOptsKey, Opts, #{}),
- Keepalive = maps:get(keepalive, ProtoOpts, Default),
+ ProtoOpts = maps:get(Protocols:opts_name(), Opts, #{}),
+ Keepalive = maps:get(keepalive, ProtoOpts, Protocol:default_keepalive()),
KeepaliveRef = case Keepalive of
infinity -> undefined;
%% @todo Maybe change that to a start_timer.