aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSlava Yurin <[email protected]>2013-01-22 19:01:56 +0700
committerSlava Yurin <[email protected]>2013-01-22 23:14:08 +0700
commit9aa0e1a58a0a9148237bd0f974507bcd914f7ef4 (patch)
treef099286c1475504fde093e06e214371810eebfcc /src
parentca9184f39ccbebf23a9e635ee24c66d555b4dc79 (diff)
downloadcowboy-9aa0e1a58a0a9148237bd0f974507bcd914f7ef4.tar.gz
cowboy-9aa0e1a58a0a9148237bd0f974507bcd914f7ef4.tar.bz2
cowboy-9aa0e1a58a0a9148237bd0f974507bcd914f7ef4.zip
Fix handler state change in cowboy_rest
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_rest.erl20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl
index f5bc22d..6816303 100644
--- a/src/cowboy_rest.erl
+++ b/src/cowboy_rest.erl
@@ -740,13 +740,13 @@ choose_content_type(Req,
"** Request was ~p~n** State was ~p~n~n",
[Handler, Fun, 2, cowboy_req:to_list(Req), HandlerState]),
{error, 500, Req};
- {halt, Req2, HandlerState} ->
- terminate(Req2, State#state{handler_state=HandlerState});
- {true, Req2, HandlerState} ->
- State2 = State#state{handler_state=HandlerState},
+ {halt, Req2, HandlerState2} ->
+ terminate(Req2, State#state{handler_state=HandlerState2});
+ {true, Req2, HandlerState2} ->
+ State2 = State#state{handler_state=HandlerState2},
next(Req2, State2, OnTrue);
- {false, Req2, HandlerState} ->
- State2 = State#state{handler_state=HandlerState},
+ {false, Req2, HandlerState2} ->
+ State2 = State#state{handler_state=HandlerState2},
respond(Req2, State2, 500)
end;
choose_content_type(Req, State, OnTrue, ContentType, [_Any|Tail]) ->
@@ -791,10 +791,10 @@ set_resp_body(Req, State=#state{handler=Handler, handler_state=HandlerState,
"** Request was ~p~n** State was ~p~n~n",
[Handler, Fun, 2, cowboy_req:to_list(Req5), HandlerState]),
{error, 500, Req5};
- {halt, Req6, HandlerState} ->
- terminate(Req6, State4#state{handler_state=HandlerState});
- {Body, Req6, HandlerState} ->
- State5 = State4#state{handler_state=HandlerState},
+ {halt, Req6, HandlerState2} ->
+ terminate(Req6, State4#state{handler_state=HandlerState2});
+ {Body, Req6, HandlerState2} ->
+ State5 = State4#state{handler_state=HandlerState2},
Req7 = case Body of
{stream, StreamFun} ->
cowboy_req:set_resp_body_fun(StreamFun, Req6);