Skip to content

Make sure we clear pings from pings map#31

Open
lixen-wg2 wants to merge 1 commit into
tsloughter:masterfrom
lixen-wg2:master
Open

Make sure we clear pings from pings map#31
lixen-wg2 wants to merge 1 commit into
tsloughter:masterfrom
lixen-wg2:master

Conversation

@lixen-wg2

Copy link
Copy Markdown

Make sure to call maps:remove/2 with the exact same key that was used to look up the ping, so the correct entry is removed.

Comment thread src/h2_connection.erl
Comment on lines +560 to +567
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),

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this all be done instead with maps:take?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I guess it makes more sense. I guess I wanted to make the diff small

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants