aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_protocol.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-01-02 08:18:18 +0100
committerLoïc Hoguin <[email protected]>2012-01-06 19:20:17 +0100
commitba87aa4193f5fadc35cbd34dc0191d2f3e2cef78 (patch)
tree14979e25726036f79b23d317e9d0eef3f33f4b79 /src/cowboy_http_protocol.erl
parent5095c27c657a80d7247c14f5a7e760f5d15fc215 (diff)
downloadcowboy-ba87aa4193f5fadc35cbd34dc0191d2f3e2cef78.tar.gz
cowboy-ba87aa4193f5fadc35cbd34dc0191d2f3e2cef78.tar.bz2
cowboy-ba87aa4193f5fadc35cbd34dc0191d2f3e2cef78.zip
Move the ensure_response call before ensure_body_processed
We want to reply as soon as possible.
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r--src/cowboy_http_protocol.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl
index 043aa11..9b71e6c 100644
--- a/src/cowboy_http_protocol.erl
+++ b/src/cowboy_http_protocol.erl
@@ -357,8 +357,8 @@ terminate_request(HandlerState, Req, State) ->
next_request(Req=#http_req{connection=Conn, buffer=Buffer},
State=#state{req_keepalive=Keepalive, max_keepalive=MaxKeepalive},
HandlerRes) ->
- BodyRes = ensure_body_processed(Req),
RespRes = ensure_response(Req),
+ BodyRes = ensure_body_processed(Req),
case {HandlerRes, BodyRes, RespRes, Conn} of
{ok, ok, ok, keepalive} when Keepalive < MaxKeepalive ->
?MODULE:parse_request(State#state{