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

Ignore stray HTTP/2 stream messages that we expect

This commit is contained in:
Loïc Hoguin 2017-11-29 16:41:40 +01:00
parent 73126e7693
commit d33a0df3fe
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764

View file

@ -490,7 +490,7 @@ down(State=#state{children=Children0}, Pid, Msg) ->
State
end.
info(State=#state{streams=Streams}, StreamID, Msg) ->
info(State=#state{client_streamid=LastStreamID, streams=Streams}, StreamID, Msg) ->
case lists:keyfind(StreamID, #stream.id, Streams) of
#stream{state=flush} ->
error_logger:error_msg("Received message ~p for terminated stream ~p.", [Msg, StreamID]),
@ -506,8 +506,14 @@ info(State=#state{streams=Streams}, StreamID, Msg) ->
stream_reset(State, StreamID, {internal_error, {Class, Exception},
'Unhandled exception in cowboy_stream:info/3.'})
end;
false when StreamID =< LastStreamID ->
%% Streams that were reset by the client or streams that are
%% in the lingering state may still have Erlang messages going
%% around. In these cases we do not want to log anything.
State;
false ->
error_logger:error_msg("Received message ~p for unknown stream ~p.", [Msg, StreamID]),
error_logger:error_msg("Received message ~p for unknown stream ~p.",
[Msg, StreamID]),
State
end.