aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_http.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gun_http.erl')
-rw-r--r--src/gun_http.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl
index be6ba7d..ff1f01c 100644
--- a/src/gun_http.erl
+++ b/src/gun_http.erl
@@ -47,6 +47,9 @@ init(Owner, Socket, Transport, [{version, Version}]) ->
#http_state{owner=Owner, socket=Socket, transport=Transport,
version=Version}.
+%% Stop looping when we got no more data.
+handle(<<>>, State) ->
+ State;
%% Close when server responds and we don't have any open streams.
handle(_, #http_state{streams=[]}) ->
close;