diff options
author | Loïc Hoguin <[email protected]> | 2014-07-14 12:56:05 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2014-07-14 12:56:05 +0200 |
commit | ea2de24f18741fc89d7a1dd6a3a0a43f3ccb1fd4 (patch) | |
tree | b7fe58ab1a3ea5728a950fb510c4a998d5836e77 /src/gun_http.erl | |
parent | 39813dc223e74e1dc8044ba56a7a29e870431495 (diff) | |
download | gun-ea2de24f18741fc89d7a1dd6a3a0a43f3ccb1fd4.tar.gz gun-ea2de24f18741fc89d7a1dd6a3a0a43f3ccb1fd4.tar.bz2 gun-ea2de24f18741fc89d7a1dd6a3a0a43f3ccb1fd4.zip |
Fix bug with HTTP and keepalive
A linebreak was sometimes introduced in the middle of the request
body.
Diffstat (limited to 'src/gun_http.erl')
-rw-r--r-- | src/gun_http.erl | 4 |
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, |