diff options
author | Loïc Hoguin <[email protected]> | 2018-12-19 14:45:39 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-12-19 14:45:39 +0100 |
commit | 9c579eb9b37836b6deacd3f0b81da8a0d1ee72a6 (patch) | |
tree | 15e7f54d0e5f938c3eb4d02e655cc99665b53555 /src/gun_http.erl | |
parent | d1cda6d1f05b672bc29bea5e84de6b0bb6815863 (diff) | |
download | gun-9c579eb9b37836b6deacd3f0b81da8a0d1ee72a6.tar.gz gun-9c579eb9b37836b6deacd3f0b81da8a0d1ee72a6.tar.bz2 gun-9c579eb9b37836b6deacd3f0b81da8a0d1ee72a6.zip |
Convert the gun process to gen_statem
Diffstat (limited to 'src/gun_http.erl')
-rw-r--r-- | src/gun_http.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl index e2b37d1..81310bf 100644 --- a/src/gun_http.erl +++ b/src/gun_http.erl @@ -18,7 +18,7 @@ -export([name/0]). -export([init/4]). -export([handle/2]). --export([close/1]). +-export([close/2]). -export([keepalive/1]). -export([request/8]). -export([request/9]). @@ -304,10 +304,11 @@ send_data_if_alive(Data, State=#http_state{streams=[Stream=#stream{ send_data_if_alive(_, State, _) -> State. -close(State=#http_state{in=body_close, streams=[_|Tail]}) -> +%% @todo Use Reason. +close(_, State=#http_state{in=body_close, streams=[_|Tail]}) -> _ = send_data_if_alive(<<>>, State, fin), close_streams(Tail); -close(#http_state{streams=Streams}) -> +close(_, #http_state{streams=Streams}) -> close_streams(Streams). close_streams([]) -> |