diff options
author | Loïc Hoguin <[email protected]> | 2012-09-16 13:57:27 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2012-09-17 13:57:28 +0200 |
commit | f205d44518800ff669ce8421dcb5f8f04fc6cccb (patch) | |
tree | 60a674ba54b5738fa01a722ebd893de8fba76ea8 /src/cowboy_rest.erl | |
parent | 8d5f8db90a10a8ca16f8f17bcb076ff4b93e9c63 (diff) | |
download | cowboy-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.erl | 2 |
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}. |