From 585c1dcd001c2cb41cc77216aed2cf729fad6cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 6 Sep 2019 15:36:41 +0200 Subject: Fix failing tests caused by DATA no longer being sent --- src/gun_http2.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.2.3