0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00

Get rid of stray messages when killing HTTP/2 request processes

This commit is contained in:
Loïc Hoguin 2017-04-18 16:33:41 +02:00
parent 061cc227b1
commit b7210d6d1a
No known key found for this signature in database
GPG key ID: 71366FF21851DF03

View file

@ -693,6 +693,9 @@ stream_call_terminate(StreamID, Reason, StreamState) ->
stream_terminate_children([], _, Acc) ->
Acc;
stream_terminate_children([{Pid, StreamID}|Tail], StreamID, Acc) ->
%% We unlink and flush the mailbox to avoid receiving a stray message.
unlink(Pid),
receive {'EXIT', Pid, _} -> ok after 0 -> ok end,
exit(Pid, kill),
stream_terminate_children(Tail, StreamID, Acc);
stream_terminate_children([Child|Tail], StreamID, Acc) ->