[asterisk-commits] dvossel: branch 1.8 r279817 - in /branches/1.8: channels/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 27 11:09:19 CDT 2010


Author: dvossel
Date: Tue Jul 27 11:09:15 2010
New Revision: 279817

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=279817
Log:
fix sip transaction match with authentication, fix confusing log message when using getaddrinfo

Modified:
    branches/1.8/channels/chan_sip.c
    branches/1.8/main/netsock2.c

Modified: branches/1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_sip.c?view=diff&rev=279817&r1=279816&r2=279817
==============================================================================
--- branches/1.8/channels/chan_sip.c (original)
+++ branches/1.8/channels/chan_sip.c Tue Jul 27 11:09:15 2010
@@ -7369,11 +7369,10 @@
 
 		/* If this is a Request, set the Via and Authorization header arguments */
 		if (req->method != SIP_RESPONSE) {
-			const char *auth_header;
 			args.ruri = REQ_OFFSET_TO_STR(req, rlPart2);
 			get_viabranch(ast_strdupa(get_header(req, "Via")), (char **) &args.viasentby, (char **) &args.viabranch);
-			auth_header = get_header(req, "WWW-Authenticate");
-			if (!ast_strlen_zero(auth_header)) {
+			if (!ast_strlen_zero(get_header(req, "Authorization")) ||
+				!ast_strlen_zero(get_header(req, "Proxy-Authorization"))) {
 				args.authentication_present = 1;
 			}
 		}

Modified: branches/1.8/main/netsock2.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/netsock2.c?view=diff&rev=279817&r1=279816&r2=279817
==============================================================================
--- branches/1.8/main/netsock2.c (original)
+++ branches/1.8/main/netsock2.c Tue Jul 27 11:09:15 2010
@@ -201,8 +201,10 @@
 	hints.ai_flags = AI_NUMERICHOST;
 #endif
 	if ((e = getaddrinfo(host, port, &hints, &res))) {
-		ast_log(LOG_ERROR, "getaddrinfo(\"%s\", \"%s\", ...): %s\n",
-			host, S_OR(port, "(null)"), gai_strerror(e));
+		if (e != EAI_NONAME) { /* if this was just a host name rather than a ip address, don't print error */
+			ast_log(LOG_ERROR, "getaddrinfo(\"%s\", \"%s\", ...): %s\n",
+				host, S_OR(port, "(null)"), gai_strerror(e));
+		}
 		return 0;
 	}
 




More information about the asterisk-commits mailing list