[asterisk-commits] tilghman: branch 1.8 r282826 - /branches/1.8/main/netsock2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 19 09:44:55 CDT 2010


Author: tilghman
Date: Thu Aug 19 09:44:51 2010
New Revision: 282826

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=282826
Log:
Only output debugging if the debug level is on.

Modified:
    branches/1.8/main/netsock2.c

Modified: branches/1.8/main/netsock2.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/netsock2.c?view=diff&rev=282826&r1=282825&r2=282826
==============================================================================
--- branches/1.8/main/netsock2.c (original)
+++ branches/1.8/main/netsock2.c Thu Aug 19 09:44:51 2010
@@ -343,7 +343,9 @@
 		 addr->len == sizeof(struct sockaddr_in6)) {
 		return ntohs(((struct sockaddr_in6 *)&addr->ss)->sin6_port);
 	}
-	ast_log(__LOG_DEBUG, file, line, func, "Not an IPv4 nor IPv6 address, cannot get port.\n");
+	if (option_debug >= 1) {
+		ast_log(__LOG_DEBUG, file, line, func, "Not an IPv4 nor IPv6 address, cannot get port.\n");
+	}
 	return 0;
 }
 
@@ -355,7 +357,7 @@
 	} else if (addr->ss.ss_family == AF_INET6 &&
 		 addr->len == sizeof(struct sockaddr_in6)) {
 		((struct sockaddr_in6 *)&addr->ss)->sin6_port = htons(port);
-	} else {
+	} else if (option_debug >= 1) {
 		ast_log(__LOG_DEBUG, file, line, func,
 			"Not an IPv4 nor IPv6 address, cannot set port.\n");
 	}
@@ -485,7 +487,7 @@
 		return 0;
 	}
 
-	if (addr->ss.ss_family != AF_INET) {
+	if (addr->ss.ss_family != AF_INET && option_debug >= 1) {
 		ast_log(__LOG_DEBUG, file, line, func, "Address family is not AF_INET\n");
 	}
 
@@ -498,7 +500,7 @@
 {
 	memcpy(&addr->ss, sin, sizeof(*sin));
 
-	if (addr->ss.ss_family != AF_INET) {
+	if (addr->ss.ss_family != AF_INET && option_debug >= 1) {
 		ast_log(__LOG_DEBUG, file, line, func, "Address family is not AF_INET\n");
 	}
 




More information about the asterisk-commits mailing list