From f720668afce15852ac340f86ef52b53a1450acd3 Mon Sep 17 00:00:00 2001 From: Mikael Lixenstrand Date: Tue, 22 Jul 2025 11:11:21 +0200 Subject: [PATCH] use same key when removing from map --- src/h2_connection.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/h2_connection.erl b/src/h2_connection.erl index 39540ebf..47d30d4a 100644 --- a/src/h2_connection.erl +++ b/src/h2_connection.erl @@ -556,13 +556,15 @@ route_frame(Event, {H, Payload}, #connection{pings = Pings}=Conn) when H#frame_header.type == ?PING, ?IS_FLAG((H#frame_header.flags), ?FLAG_ACK) -> - case maps:get(h2_frame_ping:to_binary(Payload), Pings, undefined) of + + BinPing = h2_frame_ping:to_binary(Payload), + case maps:get(BinPing, Pings, undefined) of undefined -> ok; {NotifyPid, _} -> NotifyPid ! {'PONG', self()} end, - NextPings = maps:remove(Payload, Pings), + NextPings = maps:remove(BinPing, Pings), maybe_reply(Event, {next_state, connected, Conn#connection{pings = NextPings}}, ok); route_frame(Event, {H=#frame_header{stream_id=0}, _Payload}, _SelfSettings,