aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-08-06 14:35:05 +0200
committerLoïc Hoguin <[email protected]>2012-08-06 14:35:05 +0200
commitb186d01367a1a744f6195e071611f97f9cc88f8e (patch)
tree49dc72e64317b5fd92297f9d4a9a530896f3c290
parenteabb029895c8345ccedc41ed28a023d0e75c7e0e (diff)
downloadranch-b186d01367a1a744f6195e071611f97f9cc88f8e.tar.gz
ranch-b186d01367a1a744f6195e071611f97f9cc88f8e.tar.bz2
ranch-b186d01367a1a744f6195e071611f97f9cc88f8e.zip
Make ranch_sup the owner of the ranch_server ets table
Should prove itself more robust when things go wrong.
-rw-r--r--src/ranch_server.erl2
-rw-r--r--src/ranch_sup.erl2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/ranch_server.erl b/src/ranch_server.erl
index faec9b6..b0ae612 100644
--- a/src/ranch_server.erl
+++ b/src/ranch_server.erl
@@ -95,8 +95,6 @@ remove_connection(ListenerPid) ->
%% @private
init([]) ->
- ?TAB = ets:new(?TAB, [
- ordered_set, public, named_table, {write_concurrency, true}]),
{ok, #state{}}.
%% @private
diff --git a/src/ranch_sup.erl b/src/ranch_sup.erl
index ff05194..ad1c558 100644
--- a/src/ranch_sup.erl
+++ b/src/ranch_sup.erl
@@ -33,6 +33,8 @@ start_link() ->
%% supervisor.
init([]) ->
+ ranch_server = ets:new(ranch_server, [
+ ordered_set, public, named_table, {write_concurrency, true}]),
Procs = [
{ranch_server, {ranch_server, start_link, []},
permanent, 5000, worker, [ranch_server]}