aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_data_h.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-08-02 14:30:08 +0200
committerLoïc Hoguin <[email protected]>2019-08-05 19:57:13 +0200
commit611f9a9b78cab4005892e13dffb7a2c8e44580ee (patch)
treed8d3fc407110ea12333ba122cf711326e82a7070 /src/gun_data_h.erl
parent145b9af4bdbb85e2f83959ee8abaa4d9207a4529 (diff)
downloadgun-611f9a9b78cab4005892e13dffb7a2c8e44580ee.tar.gz
gun-611f9a9b78cab4005892e13dffb7a2c8e44580ee.tar.bz2
gun-611f9a9b78cab4005892e13dffb7a2c8e44580ee.zip
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.
Diffstat (limited to 'src/gun_data_h.erl')
-rw-r--r--src/gun_data_h.erl4
1 files changed, 2 insertions, 2 deletions
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}.