diff options
Diffstat (limited to 'src/gun_http2.erl')
-rw-r--r-- | src/gun_http2.erl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gun_http2.erl b/src/gun_http2.erl index 8746b3e..b0397f0 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -30,6 +30,7 @@ -export([request/12]). -export([data/7]). -export([cancel/5]). +-export([timeout/3]). -export([stream_info/2]). -export([down/1]). @@ -709,6 +710,14 @@ cancel(State=#http2_state{socket=Socket, transport=Transport, http2_machine=HTTP EvHandlerState0} end. +timeout(State=#http2_state{http2_machine=HTTP2Machine0}, {cow_http2_machine, Name}, TRef) -> + case cow_http2_machine:timeout(Name, TRef, HTTP2Machine0) of + {ok, HTTP2Machine} -> + {state, State#http2_state{http2_machine=HTTP2Machine}}; + {error, Error={connection_error, _, _}, _HTTP2Machine} -> + connection_error(State, Error) + end. + stream_info(State, StreamRef) -> case get_stream_by_ref(State, StreamRef) of #stream{reply_to=ReplyTo} -> |