aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_websocket.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cowboy_websocket.erl b/src/cowboy_websocket.erl
index 4d77b73..04082e1 100644
--- a/src/cowboy_websocket.erl
+++ b/src/cowboy_websocket.erl
@@ -140,9 +140,12 @@ handler_init(State=#state{transport=Transport, handler=Handler, opts=Opts},
-spec upgrade_error(cowboy_req:req()) -> closed.
upgrade_error(Req) ->
- {ok, _Req2} = cowboy_req:reply(400, [], [],
- Req#http_req{resp_state=waiting}),
- closed.
+ receive
+ {cowboy_req, resp_sent} -> closed
+ after 0 ->
+ _ = cowboy_req:reply(400, [], [], Req),
+ closed
+ end.
%% @see cowboy_protocol:ensure_response/1
-spec upgrade_denied(cowboy_req:req()) -> closed.