aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_protocol.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r--src/cowboy_http_protocol.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl
index 7713a7e..9e1ad88 100644
--- a/src/cowboy_http_protocol.erl
+++ b/src/cowboy_http_protocol.erl
@@ -438,12 +438,13 @@ ensure_response(#http_req{socket=Socket, transport=Transport,
%% Only send an error reply if there is no resp_sent message.
-spec error_terminate(cowboy_http:status(), #state{}) -> ok.
-error_terminate(Code, State=#state{socket=Socket, transport=Transport}) ->
+error_terminate(Code, State=#state{socket=Socket, transport=Transport,
+ onresponse=OnResponse}) ->
receive
{cowboy_http_req, resp_sent} -> ok
after 0 ->
_ = cowboy_http_req:reply(Code, #http_req{
- socket=Socket, transport=Transport,
+ socket=Socket, transport=Transport, onresponse=OnResponse,
connection=close, pid=self(), resp_state=waiting}),
ok
end,