Merged bug23935 into default

This commit is contained in:
Emile Joubert 2012-11-04 22:04:34 +00:00
commit 72fdda9396
3 changed files with 8 additions and 8 deletions

View File

@ -356,7 +356,7 @@ handle_event(Event = #event{type = queue_deleted}, State) ->
handle_event(#event{type = connection_created, props = Stats}, State) ->
handle_created(
connection_stats, Stats,
[{fun rabbit_mgmt_format:addr/1, [address, peer_address]},
[{fun rabbit_mgmt_format:addr/1, [host, peer_host]},
{fun rabbit_mgmt_format:port/1, [port, peer_port]},
{fun rabbit_mgmt_format:protocol/1, [protocol]},
{fun rabbit_mgmt_format:amqp_table/1, [client_properties]}], State);
@ -628,15 +628,15 @@ augment_channel_pid(Pid, #state{tables = Tables}) ->
[{name, pget(name, Ch)},
{number, pget(number, Ch)},
{connection_name, pget(name, Conn)},
{peer_address, pget(peer_address, Conn)},
{peer_port, pget(peer_port, Conn)}].
{peer_port, pget(peer_port, Conn)},
{peer_host, pget(peer_host, Conn)}].
augment_connection_pid(Pid, #state{tables = Tables}) ->
Conn = lookup_element(orddict:fetch(connection_stats, Tables),
{Pid, create}),
[{name, pget(name, Conn)},
{peer_address, pget(peer_address, Conn)},
{peer_port, pget(peer_port, Conn)}].
{peer_port, pget(peer_port, Conn)},
{peer_host, pget(peer_host, Conn)}].
augment_queue_pid(Pid, _State) ->
%% TODO This should be in rabbit_amqqueue?

View File

@ -75,8 +75,8 @@ ip(IP) -> list_to_binary(rabbit_misc:ntoa(IP)).
ipb(unknown) -> unknown;
ipb(IP) -> list_to_binary(rabbit_misc:ntoab(IP)).
addr(Addr) when is_list(Addr); is_atom(Addr) -> print("~s", Addr);
addr(Addr) when is_tuple(Addr) -> ip(Addr).
addr(S) when is_list(S); is_atom(S); is_binary(S) -> print("~s", S);
addr(Addr) when is_tuple(Addr) -> ip(Addr).
port(Port) when is_number(Port) -> Port;
port(Port) -> print("~w", Port).

View File

@ -262,7 +262,7 @@ find_conn_by_local_port(Port, Items) ->
[Conn] = lists:filter(
fun(Conn) ->
pget(peer_port, Conn) == Port andalso
pget(peer_address, Conn) == <<"127.0.0.1">>
pget(peer_host, Conn) == <<"127.0.0.1">>
end, Items),
Conn.