summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-01-10 14:00:36 +0000
committerSimon MacMullen <simon@rabbitmq.com>2014-01-10 14:00:36 +0000
commitfe1201a959e3cebd642f04d4e30e0274a28cba4f (patch)
treecb63cdb60788224766829418504252af01900c2d
parent9b4ebdb1804714eb98570bb202167af3247a9971 (diff)
downloadrabbitmq-server-fe1201a959e3cebd642f04d4e30e0274a28cba4f.tar.gz
This code can now be invoked in the context of the Erlang client, in which case we are not guaranteed that the env key will be there at all.
-rw-r--r--src/rabbit_net.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rabbit_net.erl b/src/rabbit_net.erl
index e8c96818..401b8ab1 100644
--- a/src/rabbit_net.erl
+++ b/src/rabbit_net.erl
@@ -222,10 +222,9 @@ maybe_ntoab(Addr) when is_tuple(Addr) -> rabbit_misc:ntoab(Addr);
maybe_ntoab(Host) -> Host.
rdns(Addr) ->
- {ok, Lookup} = application:get_env(rabbit, reverse_dns_lookups),
- case Lookup of
- true -> list_to_binary(rabbit_networking:tcp_host(Addr));
- _ -> Addr
+ case application:get_env(rabbit, reverse_dns_lookups) of
+ {ok, true} -> list_to_binary(rabbit_networking:tcp_host(Addr));
+ _ -> Addr
end.
sock_funs(inbound) -> {fun peername/1, fun sockname/1};