diff options
author | Loïc Hoguin <[email protected]> | 2019-10-10 17:06:24 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-10-10 17:06:24 +0200 |
commit | 3ae228897a94d2506859bf351bf6c2aa9e02a6a4 (patch) | |
tree | e916a41f57fec448fc163d0f97036f24200c19ee /src/cowboy_http2.erl | |
parent | 525eeeecc92f54c1187cf21b9f8e5e03e2aef506 (diff) | |
download | cowboy-3ae228897a94d2506859bf351bf6c2aa9e02a6a4.tar.gz cowboy-3ae228897a94d2506859bf351bf6c2aa9e02a6a4.tar.bz2 cowboy-3ae228897a94d2506859bf351bf6c2aa9e02a6a4.zip |
Don't log stray messages for lingering HTTP/2 streams
Diffstat (limited to 'src/cowboy_http2.erl')
-rw-r--r-- | src/cowboy_http2.erl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cowboy_http2.erl b/src/cowboy_http2.erl index 66f129e..2754e9c 100644 --- a/src/cowboy_http2.erl +++ b/src/cowboy_http2.erl @@ -572,7 +572,7 @@ down(State=#state{opts=Opts, children=Children0}, Pid, Msg) -> State end. -info(State=#state{opts=Opts, streams=Streams}, StreamID, Msg) -> +info(State=#state{opts=Opts, http2_machine=HTTP2Machine, streams=Streams}, StreamID, Msg) -> case Streams of #{StreamID := Stream=#stream{state=StreamState0}} -> try cowboy_stream:info(StreamID, Msg, StreamState0) of @@ -587,8 +587,13 @@ info(State=#state{opts=Opts, streams=Streams}, StreamID, Msg) -> 'Unhandled exception in cowboy_stream:info/3.'}) end; _ -> - cowboy:log(warning, "Received message ~p for unknown or terminated stream ~p.", - [Msg, StreamID], Opts), + case cow_http2_machine:is_lingering_stream(StreamID, HTTP2Machine) of + true -> + ok; + false -> + cowboy:log(warning, "Received message ~p for unknown stream ~p.", + [Msg, StreamID], Opts) + end, State end. |