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:
parent
73126e7693
commit
d33a0df3fe
1 changed files with 8 additions and 2 deletions
|
@ -490,7 +490,7 @@ down(State=#state{children=Children0}, Pid, Msg) ->
|
||||||
State
|
State
|
||||||
end.
|
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
|
case lists:keyfind(StreamID, #stream.id, Streams) of
|
||||||
#stream{state=flush} ->
|
#stream{state=flush} ->
|
||||||
error_logger:error_msg("Received message ~p for terminated stream ~p.", [Msg, StreamID]),
|
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},
|
stream_reset(State, StreamID, {internal_error, {Class, Exception},
|
||||||
'Unhandled exception in cowboy_stream:info/3.'})
|
'Unhandled exception in cowboy_stream:info/3.'})
|
||||||
end;
|
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 ->
|
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
|
State
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue