aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gun_http.erl7
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}.