diff options
Diffstat (limited to 'src/gun_http2.erl')
-rw-r--r-- | src/gun_http2.erl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gun_http2.erl b/src/gun_http2.erl index 9159d78..8072a00 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -24,6 +24,7 @@ -export([request/9]). -export([data/5]). -export([cancel/3]). +-export([stream_info/2]). -export([down/1]). -record(stream, { @@ -371,6 +372,18 @@ cancel(State=#http2_state{socket=Socket, transport=Transport, error_stream_not_found(State, StreamRef, ReplyTo) end. +stream_info(State, StreamRef) -> + case get_stream_by_ref(State, StreamRef) of + #stream{reply_to=ReplyTo} -> + {ok, #{ + ref => StreamRef, + reply_to => ReplyTo, + state => running + }}; + false -> + {ok, undefined} + end. + %% @todo Add unprocessed streams when GOAWAY handling is done. down(#http2_state{streams=Streams}) -> KilledStreams = [Ref || #stream{ref=Ref} <- Streams], |