[tor-commits] [torsocks/master] Fix: change non TCP socket warning to debug

dgoulet at torproject.org dgoulet at torproject.org
Fri Apr 4 22:40:27 UTC 2014


commit 31cbca3d898e2a309bee335b49777ff650f3dc99
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Sat Nov 9 10:58:01 2013 -0500

    Fix: change non TCP socket warning to debug
    
    A fat comment is added to explain why this is done. :)
    
    CC: adrelanos <adrelanos at riseup.net>
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/lib/socket.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/lib/socket.c b/src/lib/socket.c
index dcc0444..2a50c3e 100644
--- a/src/lib/socket.c
+++ b/src/lib/socket.c
@@ -43,7 +43,16 @@ LIBC_SOCKET_RET_TYPE tsocks_socket(LIBC_SOCKET_SIG)
 		break;
 	default:
 		if (__domain == AF_INET || __domain == AF_INET6) {
-			WARN("Non TCP inet socket denied. Tor network can't handle it.");
+			/*
+			 * Print this message only in debug mode. Very often, applications
+			 * uses the libc to do DNS resolution which first tries with UDP
+			 * and then with TCP. It's not critical for the user to know that a
+			 * non TCP socket has been denied and since the libc has a fallback
+			 * that works, this message most of the time, simply polutes the
+			 * application's output which can cause issues with external
+			 * applications parsing the output.
+			 */
+			DBG("Non TCP inet socket denied. Tor network can't handle it.");
 			errno = EINVAL;
 			return -1;
 		}





More information about the tor-commits mailing list