aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gun_http.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl
index ff1f01c..bd6565c 100644
--- a/src/gun_http.erl
+++ b/src/gun_http.erl
@@ -180,8 +180,10 @@ close_streams(Owner, [{StreamRef, _}|Tail]) ->
close_streams(Owner, Tail).
%% We can only keep-alive by sending an empty line in-between streams.
-keepalive(State=#http_state{socket=Socket, transport=Transport}) ->
+keepalive(State=#http_state{socket=Socket, transport=Transport, out=head}) ->
Transport:send(Socket, <<"\r\n">>),
+ State;
+keepalive(State) ->
State.
request(State=#http_state{socket=Socket, transport=Transport, version=Version,