aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_rest.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-09-16 13:57:27 +0200
committerLoïc Hoguin <[email protected]>2012-09-17 13:57:28 +0200
commitf205d44518800ff669ce8421dcb5f8f04fc6cccb (patch)
tree60a674ba54b5738fa01a722ebd893de8fba76ea8 /src/cowboy_rest.erl
parent8d5f8db90a10a8ca16f8f17bcb076ff4b93e9c63 (diff)
downloadcowboy-f205d44518800ff669ce8421dcb5f8f04fc6cccb.tar.gz
cowboy-f205d44518800ff669ce8421dcb5f8f04fc6cccb.tar.bz2
cowboy-f205d44518800ff669ce8421dcb5f8f04fc6cccb.zip
Add a function to lock request responses instead of inlining
Just more cleanup in order to have req() opaque.
Diffstat (limited to 'src/cowboy_rest.erl')
-rw-r--r--src/cowboy_rest.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy_rest.erl b/src/cowboy_rest.erl
index a6c3672..9e5904c 100644
--- a/src/cowboy_rest.erl
+++ b/src/cowboy_rest.erl
@@ -897,7 +897,7 @@ respond(Req, State, StatusCode) ->
terminate(Req, #state{handler=Handler, handler_state=HandlerState}) ->
case erlang:function_exported(Handler, rest_terminate, 2) of
true -> ok = Handler:rest_terminate(
- Req#http_req{resp_state=locked}, HandlerState);
+ cowboy_req:lock(Req), HandlerState);
false -> ok
end,
{ok, Req}.