aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-03-25 11:03:09 +0100
committerLoïc Hoguin <[email protected]>2014-03-25 11:06:21 +0100
commit0c0caa3a471591a9f77a9a3198972de0d755766e (patch)
treeed152668726c6763cc9ac2debf5141c57e3396fc /src
parent704f61c9d170ef6d4fa3eec1b8be0c76893d7104 (diff)
downloadcowboy-0c0caa3a471591a9f77a9a3198972de0d755766e.tar.gz
cowboy-0c0caa3a471591a9f77a9a3198972de0d755766e.tar.bz2
cowboy-0c0caa3a471591a9f77a9a3198972de0d755766e.zip
Don't flush the resp_sent message if connection is closed
Tiny optimization.
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_protocol.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl
index 78c641d..f0be133 100644
--- a/src/cowboy_protocol.erl
+++ b/src/cowboy_protocol.erl
@@ -512,8 +512,8 @@ next_request(Req, State=#state{req_keepalive=Keepalive, timeout=Timeout},
_ -> close
end,
%% Flush the resp_sent message before moving on.
- receive {cowboy_req, resp_sent} -> ok after 0 -> ok end,
if HandlerRes =:= ok, Buffer =/= close ->
+ receive {cowboy_req, resp_sent} -> ok after 0 -> ok end,
?MODULE:parse_request(Buffer,
State#state{req_keepalive=Keepalive + 1,
until=until(Timeout)}, 0);