aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http2.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-11-29 16:41:40 +0100
committerLoïc Hoguin <[email protected]>2017-11-29 16:41:40 +0100
commitd33a0df3fe3d8b0b3bc64e66df883f9b20b76780 (patch)
tree0c22fe6e8d6feae8ac36fea50ca588b4c3ec894c /src/cowboy_http2.erl
parent73126e7693387f1865d04fe3d5384ea5060ac2f0 (diff)
downloadcowboy-d33a0df3fe3d8b0b3bc64e66df883f9b20b76780.tar.gz
cowboy-d33a0df3fe3d8b0b3bc64e66df883f9b20b76780.tar.bz2
cowboy-d33a0df3fe3d8b0b3bc64e66df883f9b20b76780.zip
Ignore stray HTTP/2 stream messages that we expect
Diffstat (limited to 'src/cowboy_http2.erl')
-rw-r--r--src/cowboy_http2.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cowboy_http2.erl b/src/cowboy_http2.erl
index 0301099..8011196 100644
--- a/src/cowboy_http2.erl
+++ b/src/cowboy_http2.erl
@@ -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.