aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_protocol.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_protocol.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_protocol.erl')
-rw-r--r--src/cowboy_protocol.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl
index 04b42a5..ad22141 100644
--- a/src/cowboy_protocol.erl
+++ b/src/cowboy_protocol.erl
@@ -383,7 +383,7 @@ handler_call(HandlerState, Req, State=#state{handler={Handler, Opts}},
-spec handler_terminate(any(), cowboy_req:req(), #state{}) -> ok.
handler_terminate(HandlerState, Req, #state{handler={Handler, Opts}}) ->
try
- Handler:terminate(Req#http_req{resp_state=locked}, HandlerState)
+ Handler:terminate(cowboy_req:lock(Req), HandlerState)
catch Class:Reason ->
PLReq = cowboy_req:to_list(Req),
error_logger:error_msg(