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
commit167dcf61da001c0f5afe9576fb22c5c6c4a2b886 (patch)
treebd934f690cefbdef087713b7514e8de67c5c40bb
parentbec252f5a67964902750a56aee1ff78d17c0fcb7 (diff)
downloadrabbitmq-server-167dcf61da001c0f5afe9576fb22c5c6c4a2b886.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 33ae20e5..040b81bb 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.
%%--------------------------------------------------------------------