[asterisk-commits] diruggles: trunk r233545 - /trunk/apps/app_externalivr.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 7 13:48:17 CST 2009


Author: diruggles
Date: Mon Dec  7 13:48:14 2009
New Revision: 233545

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=233545
Log:
Fix TCP Client interface

Fix a couple of very minor bugs that prevent the socket client from working. The wrong set of properties were used in one place and the size of the address variable isn't set if the host name is an ip address. Also includes a fix for a bug that was introduced previously.

(closes issue #16121)
Reported by: thedavidfactor
Tested by: thedavidfactor

Review: https://reviewboard.asterisk.org/r/439/

Modified:
    trunk/apps/app_externalivr.c

Modified: trunk/apps/app_externalivr.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_externalivr.c?view=diff&rev=233545&r1=233544&r2=233545
==============================================================================
--- trunk/apps/app_externalivr.c (original)
+++ trunk/apps/app_externalivr.c Mon Dec  7 13:48:14 2009
@@ -419,7 +419,7 @@
 	}
 
 	/* Get rid of any extraneous arguments */
-	if ((s = strchr(eivr_args.options, ','))) {
+	if (eivr_args.options && (s = strchr(eivr_args.options, ','))) {
 		*s = '\0';
 	}
 
@@ -473,9 +473,9 @@
 		}
 
 		ast_gethostbyname(hostname, &hp);
-		ivr_desc.local_address.sin_family = AF_INET;
-		ivr_desc.local_address.sin_port = htons(port);
-		memcpy(&ivr_desc.local_address.sin_addr.s_addr, hp.hp.h_addr, hp.hp.h_length);
+		ivr_desc.remote_address.sin_family = AF_INET;
+		ivr_desc.remote_address.sin_port = htons(port);
+		memcpy(&ivr_desc.remote_address.sin_addr.s_addr, hp.hp.h_addr, sizeof(hp.hp.h_addr));
 		if (!(ser = ast_tcptls_client_create(&ivr_desc)) || !(ser = ast_tcptls_client_start(ser))) {
 			goto exit;
 		}




More information about the asterisk-commits mailing list