diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-01-10 14:00:36 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-01-10 14:00:36 +0000 |
| commit | fe1201a959e3cebd642f04d4e30e0274a28cba4f (patch) | |
| tree | cb63cdb60788224766829418504252af01900c2d | |
| parent | 9b4ebdb1804714eb98570bb202167af3247a9971 (diff) | |
| download | rabbitmq-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.erl | 7 |
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}; |
