aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_http2.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-09-06 15:36:41 +0200
committerLoïc Hoguin <[email protected]>2019-09-06 15:36:41 +0200
commit585c1dcd001c2cb41cc77216aed2cf729fad6cc7 (patch)
tree32bc48e5bf467dc74cd2a712fde5410bd99abf32 /src/gun_http2.erl
parent7103aac46c8e4e505a47e4aeabe0102ecf168b8f (diff)
downloadgun-585c1dcd001c2cb41cc77216aed2cf729fad6cc7.tar.gz
gun-585c1dcd001c2cb41cc77216aed2cf729fad6cc7.tar.bz2
gun-585c1dcd001c2cb41cc77216aed2cf729fad6cc7.zip
Fix failing tests caused by DATA no longer being sent
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;