Skip to content

Commit

Permalink
Move the ensure_response call before ensure_body_processed
Browse files Browse the repository at this point in the history
We want to reply as soon as possible.
  • Loading branch information
Loïc Hoguin committed Jan 6, 2012
1 parent 5095c27 commit ba87aa4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cowboy_http_protocol.erl
Expand Up @@ -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{
Expand Down

0 comments on commit ba87aa4

Please sign in to comment.