aboutsummaryrefslogtreecommitdiffstats
path: root/src/ranch_server.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_server.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_server.erl')
-rw-r--r--src/ranch_server.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ranch_server.erl b/src/ranch_server.erl
index 7ded858..16e892d 100644
--- a/src/ranch_server.erl
+++ b/src/ranch_server.erl
@@ -117,8 +117,9 @@ code_change(_OldVsn, State, _Extra) ->
-spec remove_process(key(), reference(), pid(), Monitors)
-> Monitors when Monitors::monitors() .
-remove_process(Key = {listener, _}, MonitorRef, Pid, Monitors) ->
+remove_process(Key = {listener, Ref}, MonitorRef, Pid, Monitors) ->
true = ets:delete(?TAB, Key),
+ true = ets:delete(?TAB, {acceptors, Ref}),
lists:keydelete({MonitorRef, Pid}, 1, Monitors);
remove_process(Key = {acceptors, _}, MonitorRef, Pid, Monitors) ->
Acceptors = ets:lookup_element(?TAB, Key, 2),