summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_networking.erl13
-rw-r--r--src/rabbit_reader.erl2
2 files changed, 6 insertions, 9 deletions
diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl
index 31eeef730c..52163354b6 100644
--- a/src/rabbit_networking.erl
+++ b/src/rabbit_networking.erl
@@ -117,6 +117,9 @@
%%----------------------------------------------------------------------------
boot() ->
+ %% This exists to disambiguate 0-x connections from 1.0 ones
+ %% (since they are both children of the same supervisor).
+ ets:new(?CONNECTION_TABLE, [public, named_table]),
ok = start(),
ok = boot_tcp(),
ok = boot_ssl().
@@ -299,15 +302,7 @@ connections() ->
rabbit_networking, connections_local, []).
connections_local() ->
- [Reader ||
- {_, ConnSup, supervisor, _}
- <- supervisor:which_children(rabbit_tcp_client_sup),
- Reader <- [try
- rabbit_connection_sup:reader(ConnSup)
- catch exit:{noproc, _} ->
- noproc
- end],
- Reader =/= noproc].
+ [P || {P} <- ets:tab2list(?CONNECTION_TABLE)].
connection_info_keys() -> rabbit_reader:info_keys().
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index e146216357..fae65b1dbe 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -265,6 +265,7 @@ start_connection(Parent, ConnSupPid, Collector, StartHeartbeatFun, Deb,
%% the socket. However, to keep the file_handle_cache
%% accounting as accurate as possible we ought to close the
%% socket w/o delay before termination.
+ ets:delete(?CONNECTION_TABLE, self()),
rabbit_net:fast_close(ClientSock),
rabbit_event:notify(connection_closed, [{pid, self()}])
end,
@@ -721,6 +722,7 @@ handle_input(Callback, Data, _State) ->
start_connection({ProtocolMajor, ProtocolMinor, _ProtocolRevision},
Protocol,
State = #v1{sock = Sock, connection = Connection}) ->
+ ets:insert(?CONNECTION_TABLE, {self()}),
Start = #'connection.start'{
version_major = ProtocolMajor,
version_minor = ProtocolMinor,