OSDN Git Service

InetAddress: Stop logging DNS lookups to logcat.
authorMike Lockwood <lockwood@android.com>
Thu, 28 May 2009 14:19:17 +0000 (10:19 -0400)
committerMike Lockwood <lockwood@android.com>
Thu, 28 May 2009 14:19:17 +0000 (10:19 -0400)
Logging all DNS lookups system wide raises privacy concerns to me
and might make people less likely to include logs in their bug reports.

Signed-off-by: Mike Lockwood <lockwood@android.com>
libcore/luni/src/main/native/java_net_InetAddress.cpp

index 0eb2753..c0666d5 100644 (file)
@@ -16,6 +16,8 @@
 
 #define LOG_TAG "InetAddress"
 
+#define LOG_DNS 0
+
 #include "JNIHelp.h"
 #include "utils/Log.h"
 #include "jni.h"
@@ -59,6 +61,7 @@ static void throwNullPointerException(JNIEnv* env)
     }
 }
 
+#if LOG_DNS
 static void logIpString(struct addrinfo* ai, const char* name)
 {
     char ipString[INET6_ADDRSTRLEN];
@@ -71,6 +74,11 @@ static void logIpString(struct addrinfo* ai, const char* name)
         LOGE("%s: getnameinfo: %s", name, gai_strerror(result));
     }
 }
+#else
+static inline void logIpString(struct addrinfo* ai, const char* name)
+{
+}
+#endif
 
 static jobjectArray getAllByNameUsingAdb(JNIEnv* env, const char* name)
 {