summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2010-12-21 16:21:43 +0000
committerSimon MacMullen <simon@rabbitmq.com>2010-12-21 16:21:43 +0000
commit29799ae7b7658835d23414dac8daab69fe6956ae (patch)
treebd934f690cefbdef087713b7514e8de67c5c40bb
parent43ebb9465bca66ae20b54c0677dbd0574968c89b (diff)
downloadrabbitmq-server-git-29799ae7b7658835d23414dac8daab69fe6956ae.tar.gz
Matthew says we really need that check, so make connections() return connections from all nodes.
-rw-r--r--src/rabbit_networking.erl13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/rabbit_networking.erl b/src/rabbit_networking.erl
index 33ae20e58c..040b81bb63 100644
--- a/src/rabbit_networking.erl
+++ b/src/rabbit_networking.erl
@@ -245,9 +245,11 @@ start_ssl_client(SslOpts, Sock) ->
end).
connections() ->
- [rabbit_connection_sup:reader(ConnSup) ||
- {_, ConnSup, supervisor, _}
- <- supervisor:which_children(rabbit_tcp_client_sup)].
+ lists:flatten(
+ [[rabbit_connection_sup:reader(ConnSup) ||
+ {_, ConnSup, supervisor, _}
+ <- supervisor:which_children({rabbit_tcp_client_sup, Node})]
+ || Node <- mnesia:system_info(running_db_nodes)]).
connection_info_keys() -> rabbit_reader:info_keys().
@@ -258,7 +260,10 @@ connection_info_all() -> cmap(fun (Q) -> connection_info(Q) end).
connection_info_all(Items) -> cmap(fun (Q) -> connection_info(Q, Items) end).
close_connection(Pid, Explanation) ->
- rabbit_reader:shutdown(Pid, Explanation).
+ case lists:member(Pid, connections()) of
+ true -> rabbit_reader:shutdown(Pid, Explanation);
+ false -> throw({error, {not_a_connection_pid, Pid}})
+ end.
%%--------------------------------------------------------------------