diff options
author | Loïc Hoguin <[email protected]> | 2020-02-10 09:48:14 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-02-10 09:48:14 +0100 |
commit | 1b7b5ca356609574dac30dbec846dbd75718624e (patch) | |
tree | 51055238f2621f79b7520034b642a8a91e484255 /src/gun_http2.erl | |
parent | bd6425ab87428cf4c95f4d23e0a48fd065fbd714 (diff) | |
download | gun-1b7b5ca356609574dac30dbec846dbd75718624e.tar.gz gun-1b7b5ca356609574dac30dbec846dbd75718624e.tar.bz2 gun-1b7b5ca356609574dac30dbec846dbd75718624e.zip |
Handle cow_http2_machine timeouts
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} -> |