[thrift] don't do a reverse DNS lookup for every erlang thrift request
Reviewed By: cpiro
Test Plan: ran a server ... verified its debug messages no longer included
hostnames
Notes: methinks this binding is not long for this world
Revert Plan: sure ... if you don't like your dns server
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665505 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/erl/src/transport/tErlAcceptor.erl b/lib/erl/src/transport/tErlAcceptor.erl
index bcfcb9a..c2c8f9c 100644
--- a/lib/erl/src/transport/tErlAcceptor.erl
+++ b/lib/erl/src/transport/tErlAcceptor.erl
@@ -152,21 +152,6 @@
%% helper functions
%% @param Socket the socket in question
-%% TODO(cpiro): there probably needs to be a switch for DoLookup somewhere prominent and outside the lib,
-%% probably at the "application" level
render_addr(Socket) ->
- DoLookup = true,
- {ok, {Peer, Port}} = inet:peername(Socket),
-
- case Peer of
- _ when DoLookup ->
- case catch inet:gethostbyaddr(Peer) of
- {ok, Hostent} ->
- thrift_utils:sformat("~s:~p", [Hostent#hostent.h_name, Port]);
- _ ->
- "??"
- end;
-
- {A,B,C,D} when not DoLookup ->
- thrift_utils:sformat("~p.~p.~p.~p:~p", [A,B,C,D,Port])
- end.
+ {ok, {{A,B,C,D}, Port}} = inet:peername(Socket),
+ thrift_utils:sformat("~p.~p.~p.~p:~p", [A,B,C,D,Port]).