aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_http2.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gun_http2.erl')
-rw-r--r--src/gun_http2.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gun_http2.erl b/src/gun_http2.erl
index 90083c1..1726528 100644
--- a/src/gun_http2.erl
+++ b/src/gun_http2.erl
@@ -528,8 +528,14 @@ request(State0=#http2_state{socket=Socket, transport=Transport, opts=Opts,
Stream = #stream{id=StreamID, ref=StreamRef, reply_to=ReplyTo, flow=InitialFlow},
State = State0#http2_state{http2_machine=HTTP2Machine, streams=[Stream|Streams]},
case IsFin of
- fin -> {State, EvHandlerState};
- nofin -> maybe_send_data(State, StreamID, fin, Body, EvHandler, EvHandlerState)
+ fin ->
+ RequestEndEvent = #{
+ stream_ref => StreamRef,
+ reply_to => ReplyTo
+ },
+ {State, EvHandler:request_end(RequestEndEvent, EvHandlerState)};
+ nofin ->
+ maybe_send_data(State, StreamID, fin, Body, EvHandler, EvHandlerState)
end.
initial_flow(infinity, #{flow := InitialFlow}) -> InitialFlow;