summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Ionescu <vlad@lshift.net>2009-09-14 16:10:21 +0100
committerVlad Ionescu <vlad@lshift.net>2009-09-14 16:10:21 +0100
commit8f113ab81b931589b42383ff74232f9a158f249c (patch)
tree3ee4cdffed18387bc92857e29de47e25f7458fe1
parentac7b3b581168a7fb7f37e9fe01a4bb7824e9480f (diff)
downloadrabbitmq-server-8f113ab81b931589b42383ff74232f9a158f249c.tar.gz
using '' instead of '$none' for undefined username, printing nothing for undefined username; adding state to the default list for list_connections in rabbit_control
-rw-r--r--src/rabbit_control.erl6
-rw-r--r--src/rabbit_reader.erl2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl
index 3258a04b..36509358 100644
--- a/src/rabbit_control.erl
+++ b/src/rabbit_control.erl
@@ -271,7 +271,7 @@ action(list_bindings, Node, Args, Inform) ->
action(list_connections, Node, Args, Inform) ->
Inform("Listing connections", []),
ArgAtoms = list_replace(node, pid,
- default_if_empty(Args, [user, peer_address, peer_port])),
+ default_if_empty(Args, [user, peer_address, peer_port, state])),
display_info_list(rpc_call(Node, rabbit_networking, connection_info_all,
[ArgAtoms]),
ArgAtoms);
@@ -330,14 +330,14 @@ format_info_item(Items, Key) ->
case Info of
{_, #resource{name = Name}} ->
escape(Name);
- {_, '$none'} ->
- "(none)";
_ when Key =:= address; Key =:= peer_address andalso is_tuple(Value) ->
inet_parse:ntoa(Value);
_ when is_pid(Value) ->
atom_to_list(node(Value));
_ when is_binary(Value) ->
escape(Value);
+ _ when is_atom(Value) ->
+ io_lib:format("~s", [Value]);
_ ->
io_lib:format("~w", [Value])
end.
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index 435919b6..690e6f0e 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -703,7 +703,7 @@ i(channels, #v1{}) ->
i(user, #v1{connection = #connection{user = #user{username = Username}}}) ->
Username;
i(user, #v1{connection = #connection{user = none}}) ->
- '$none';
+ '';
i(vhost, #v1{connection = #connection{vhost = VHost}}) ->
VHost;
i(timeout, #v1{connection = #connection{timeout_sec = Timeout}}) ->