diff options
author | Loïc Hoguin <[email protected]> | 2019-07-25 10:25:06 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-07-25 10:25:06 +0200 |
commit | 9e73a972b73a67dc5b8f23f99061f20713148e4e (patch) | |
tree | d078bd60185cdd7f7d5c28f4408e4e41c5a032bc /src | |
parent | 3d1e3c9e6e779bca839b86717adb2487b4a1c2c6 (diff) | |
download | gun-9e73a972b73a67dc5b8f23f99061f20713148e4e.tar.gz gun-9e73a972b73a67dc5b8f23f99061f20713148e4e.tar.bz2 gun-9e73a972b73a67dc5b8f23f99061f20713148e4e.zip |
Fix missing response_end event for HTTP/1.0 body_close
Diffstat (limited to 'src')
-rw-r--r-- | src/gun_http.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl index 738b6e9..08a287c 100644 --- a/src/gun_http.erl +++ b/src/gun_http.erl @@ -404,8 +404,13 @@ send_data_if_alive(_, State, _) -> State. %% @todo Use Reason. -close(_, State=#http_state{in=body_close, streams=[_|Tail]}, _, EvHandlerState) -> +close(_, State=#http_state{in=body_close, streams=[#stream{ref=StreamRef, reply_to=ReplyTo}|Tail]}, + EvHandler, EvHandlerState0) -> _ = send_data_if_alive(<<>>, State, fin), + EvHandlerState = EvHandler:response_end(#{ + stream_ref => StreamRef, + reply_to => ReplyTo + }, EvHandlerState0), {close_streams(Tail), EvHandlerState}; close(_, #http_state{streams=Streams}, _, EvHandlerState) -> {close_streams(Streams), EvHandlerState}. |