From 611f9a9b78cab4005892e13dffb7a2c8e44580ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 2 Aug 2019 14:30:08 +0200 Subject: Add flow control Flow control is disabled by default. The initial flow value must be set to enable it (either for the entire connection or on a per-request basis). Flow applies to all HTTP streams as well as Websocket. HTTP/2 pushed streams receive the same value as their originating stream. --- src/gun_data_h.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gun_data_h.erl') diff --git a/src/gun_data_h.erl b/src/gun_data_h.erl index af2c2cb..d1f8787 100644 --- a/src/gun_data_h.erl +++ b/src/gun_data_h.erl @@ -27,7 +27,7 @@ init(ReplyTo, StreamRef, _, _, _) -> {ok, #state{reply_to=ReplyTo, stream_ref=StreamRef}}. --spec handle(fin | nofin, binary(), State) -> {done, State} when State::#state{}. +-spec handle(fin | nofin, binary(), State) -> {done, 1, State} when State::#state{}. handle(IsFin, Data, State=#state{reply_to=ReplyTo, stream_ref=StreamRef}) -> ReplyTo ! {gun_data, self(), StreamRef, IsFin, Data}, - {done, State}. + {done, 1, State}. -- cgit v1.2.3