aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_ws.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-04-10 17:34:26 +0300
committerLoïc Hoguin <[email protected]>2015-04-10 17:34:26 +0300
commitf618634bf648124c9562aaf49ee460be9ef71ae7 (patch)
treea0bd678d5e053358d3662ee626db677ab6033b2e /src/gun_ws.erl
parentcff0a87d3cbdcf67a9049cdc2784d459711e2867 (diff)
downloadgun-f618634bf648124c9562aaf49ee460be9ef71ae7.tar.gz
gun-f618634bf648124c9562aaf49ee460be9ef71ae7.tar.bz2
gun-f618634bf648124c9562aaf49ee460be9ef71ae7.zip
Add headers to gun_ws_upgrade message
Also improves the code and documentation about this message. It was incorrectly specified that a gun_ws_upgrade message could be sent on error; instead a gun_response is sent.
Diffstat (limited to 'src/gun_ws.erl')
-rw-r--r--src/gun_ws.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gun_ws.erl b/src/gun_ws.erl
index 66d0fa2..a8154d6 100644
--- a/src/gun_ws.erl
+++ b/src/gun_ws.erl
@@ -16,7 +16,7 @@
-export([check_options/1]).
-export([name/0]).
--export([init/5]).
+-export([init/6]).
-export([handle/2]).
-export([send/2]).
-export([down/1]).
@@ -56,8 +56,8 @@ do_check_options([Opt|_]) ->
name() -> ws.
%% @todo Protocols
-init(Owner, Socket, Transport, Extensions, _Protocols) ->
- Owner ! {gun_ws_upgrade, self(), ok},
+init(Owner, Socket, Transport, Headers, Extensions, _Protocols) ->
+ Owner ! {gun_ws_upgrade, self(), ok, Headers},
{upgrade, ?MODULE, #ws_state{owner=Owner, socket=Socket, transport=Transport, extensions=Extensions}}.
%% Do not handle anything if we received a close frame.