mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 20:50:24 +00:00
Don't flush the resp_sent message if connection is closed
Tiny optimization.
This commit is contained in:
parent
704f61c9d1
commit
0c0caa3a47
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue