File gun-2.2.0-map_get.patch of Package gun
diff -Ndurp gun-2.2.0/src/gun_http2.erl gun-2.2.0-map_get/src/gun_http2.erl
--- gun-2.2.0/src/gun_http2.erl 2025-04-11 13:42:09.000000000 +0300
+++ gun-2.2.0-map_get/src/gun_http2.erl 2025-04-24 17:00:12.719673985 +0300
@@ -981,8 +981,9 @@ close_stream(State, #stream{ref=StreamRe
gun:reply(ReplyTo, {gun_error, self(), stream_ref(State, StreamRef), Reason}),
ok.
-keepalive(State=#http2_state{pings_unack=PingsUnack, opts=Opts}, _, EvHandlerState)
- when PingsUnack >= map_get(keepalive_tolerance, Opts) ->
+keepalive(State=#http2_state{pings_unack=PingsUnack, opts=#{keepalive_tolerance := KeepaliveTolerance}},
+ _, EvHandlerState)
+ when PingsUnack >= KeepaliveTolerance ->
{connection_error(State, {connection_error, no_error,
'The number of unacknowledged pings exceed the configured tolerance value.'}),
EvHandlerState};