aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch_acceptor.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-07-25 11:40:30 +0200
committerLoïc Hoguin <[email protected]>2012-07-25 21:26:15 +0200
commit7d52280c2e3fcc9e1b89435c98ef96d4758aed7a (patch)
tree0aed63afc8c19c822748ef439c65239a8f4e707d /src/ranch_acceptor.erl
parent1d2940b37917a9217338caa4dea37890ac5b96d3 (diff)
downloadranch-7d52280c2e3fcc9e1b89435c98ef96d4758aed7a.tar.gz
ranch-7d52280c2e3fcc9e1b89435c98ef96d4758aed7a.tar.bz2
ranch-7d52280c2e3fcc9e1b89435c98ef96d4758aed7a.zip
Make acceptors query the protocol opts on startup
This way, if a crash happens in one of them after a protocol options upgrade has occured, the restarted acceptor will get the upgraded options as expected, and not the initial ones.
Diffstat (limited to 'src/ranch_acceptor.erl')
-rw-r--r--src/ranch_acceptor.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ranch_acceptor.erl b/src/ranch_acceptor.erl
index 040145b..692277b 100644
--- a/src/ranch_acceptor.erl
+++ b/src/ranch_acceptor.erl
@@ -16,17 +16,17 @@
-module(ranch_acceptor).
%% API.
--export([start_link/7]).
+-export([start_link/6]).
%% Internal.
-export([acceptor/7]).
%% API.
--spec start_link(any(), inet:socket(), module(), module(), any(),
- pid(), pid()) -> {ok, pid()}.
-start_link(Ref, LSocket, Transport, Protocol, Opts,
- ListenerPid, ConnsSup) ->
+-spec start_link(any(), inet:socket(), module(), module(), pid(), pid())
+ -> {ok, pid()}.
+start_link(Ref, LSocket, Transport, Protocol, ListenerPid, ConnsSup) ->
+ {ok, Opts} = ranch_listener:get_protocol_options(ListenerPid),
Pid = spawn_link(?MODULE, acceptor,
[LSocket, Transport, Protocol, Opts, 1, ListenerPid, ConnsSup]),
ok = ranch_server:add_acceptor(Ref, Pid),