Skip to content

Commit 79b4481

Browse files
committed
merge bug21596 into default
2 parents c0200cb + 19ab559 commit 79b4481

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

docs/rabbitmqctl.1.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ separated by tab characters.
287287
List queue information by virtual host. Each line printed describes an
288288
connection, with the requested I<connectioninfoitem> values separated
289289
by tab characters. If no I<connectioninfoitem>s are specified then
290-
I<user>, I<peer_address> and I<peer_port> are assumed.
290+
I<user>, I<peer_address>, I<peer_port> and I<state> are assumed.
291291

292292
=back
293293

src/rabbit_control.erl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ exchange name, routing key, queue name and arguments, in that order.
164164
<ConnectionInfoItem> must be a member of the list [node, address, port,
165165
peer_address, peer_port, state, channels, user, vhost, timeout, frame_max,
166166
recv_oct, recv_cnt, send_oct, send_cnt, send_pend]. The default is to display
167-
user, peer_address and peer_port.
167+
user, peer_address, peer_port and state.
168168
169169
"),
170170
halt(1).
@@ -270,8 +270,9 @@ action(list_bindings, Node, Args, Inform) ->
270270

271271
action(list_connections, Node, Args, Inform) ->
272272
Inform("Listing connections", []),
273-
ArgAtoms = list_replace(node, pid,
274-
default_if_empty(Args, [user, peer_address, peer_port])),
273+
ArgAtoms = list_replace(node, pid,
274+
default_if_empty(Args, [user, peer_address,
275+
peer_port, state])),
275276
display_info_list(rpc_call(Node, rabbit_networking, connection_info_all,
276277
[ArgAtoms]),
277278
ArgAtoms);
@@ -336,6 +337,8 @@ format_info_item(Key, Items) ->
336337
atom_to_list(node(Value));
337338
Value when is_binary(Value) ->
338339
escape(Value);
340+
Value when is_atom(Value) ->
341+
escape(atom_to_list(Value));
339342
Value ->
340343
io_lib:format("~w", [Value])
341344
end.
@@ -362,7 +365,9 @@ rpc_call(Node, Mod, Fun, Args) ->
362365
%% form part of UTF-8 strings.
363366

364367
escape(Bin) when binary(Bin) ->
365-
escape_char(lists:reverse(binary_to_list(Bin)), []).
368+
escape(binary_to_list(Bin));
369+
escape(L) when is_list(L) ->
370+
escape_char(lists:reverse(L), []).
366371

367372
escape_char([$\\ | T], Acc) ->
368373
escape_char(T, [$\\, $\\ | Acc]);

src/rabbit_reader.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ i(channels, #v1{}) ->
703703
i(user, #v1{connection = #connection{user = #user{username = Username}}}) ->
704704
Username;
705705
i(user, #v1{connection = #connection{user = none}}) ->
706-
none;
706+
'';
707707
i(vhost, #v1{connection = #connection{vhost = VHost}}) ->
708708
VHost;
709709
i(timeout, #v1{connection = #connection{timeout_sec = Timeout}}) ->

0 commit comments

Comments
 (0)