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 c4291bc..e2b37d1 100644
--- a/src/gun_http.erl
+++ b/src/gun_http.erl
@@ -319,6 +319,9 @@ close_streams([#stream{ref=StreamRef, reply_to=ReplyTo}|Tail]) ->
"The connection was lost."}},
close_streams(Tail).
+%% We don't send a keep-alive when a CONNECT request was initiated.
+keepalive(State=#http_state{streams=[#stream{ref={connect, _, _}}]}) ->
+ State;
%% We can only keep-alive by sending an empty line in-between streams.
keepalive(State=#http_state{socket=Socket, transport=Transport, out=head}) ->
Transport:send(Socket, <<"\r\n">>),