From f205d44518800ff669ce8421dcb5f8f04fc6cccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sun, 16 Sep 2012 13:57:27 +0200 Subject: Add a function to lock request responses instead of inlining Just more cleanup in order to have req() opaque. --- src/cowboy_protocol.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cowboy_protocol.erl') 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( -- cgit v1.2.3