0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 20:50:24 +00:00

Move the ensure_response call before ensure_body_processed

We want to reply as soon as possible.
This commit is contained in:
Loïc Hoguin 2012-01-02 08:18:18 +01:00
parent 5095c27c65
commit ba87aa4193

View file

@ -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{