From 7d52280c2e3fcc9e1b89435c98ef96d4758aed7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 25 Jul 2012 11:40:30 +0200 Subject: 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. --- src/ranch_acceptor.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ranch_acceptor.erl') 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), -- cgit v1.2.3