aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-06-09 16:35:04 +0200
committerLoïc Hoguin <[email protected]>2014-06-09 16:35:04 +0200
commit517fec25dcacb0b89148656139f90d91f63de17c (patch)
tree61a6cd44028ac2655dcab324a10ef4a49084779d
parent71df001167e423b0661b56406a3052cca02c9ce1 (diff)
parent342bcc5834e47bf531f90a4aae4f758d30bffffd (diff)
downloadgun-517fec25dcacb0b89148656139f90d91f63de17c.tar.gz
gun-517fec25dcacb0b89148656139f90d91f63de17c.tar.bz2
gun-517fec25dcacb0b89148656139f90d91f63de17c.zip
Merge branch 'fix-keepalive-response' of git://github.com/unix1/gun
-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 46f5a53..5af1b12 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}.
+%% Close when server responds and we don't have any open streams.
+handle(_, #http_state{streams=[]}) ->
+ close;
%% Wait for the full response headers before trying to parse them.
handle(Data, State=#http_state{in=head, buffer=Buffer}) ->
Data2 = << Buffer/binary, Data/binary >>,