[svn-commits] dvossel: branch 1.6.2 r320271 - /branches/1.6.2/main/tcptls.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri May 20 16:25:00 CDT 2011


Author: dvossel
Date: Fri May 20 16:24:48 2011
New Revision: 320271

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=320271
Log:
Fixes issue with ast_tcptls_server_start failing on second attempt to bind.

(closes issue #19289)
Reported by: wdoekes
Patches: 
      issue19289_delay_old_address_setting_tcptls.patch uploaded by wdoekes (license 717)


Modified:
    branches/1.6.2/main/tcptls.c

Modified: branches/1.6.2/main/tcptls.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/tcptls.c?view=diff&rev=320271&r1=320270&r2=320271
==============================================================================
--- branches/1.6.2/main/tcptls.c (original)
+++ branches/1.6.2/main/tcptls.c Fri May 20 16:24:48 2011
@@ -389,7 +389,8 @@
 		return NULL;
 	}
 
-	desc->old_address = desc->remote_address;
+	/* If we return early, there is no connection */
+	desc->old_address.sin_family = 0;
 
 	if (desc->accept_fd != -1)
 		close(desc->accept_fd);
@@ -424,6 +425,8 @@
 	tcptls_session->parent->worker_fn = NULL;
 	memcpy(&tcptls_session->remote_address, &desc->remote_address, sizeof(tcptls_session->remote_address));
 
+	/* Set current info */
+	desc->old_address = desc->remote_address;
 	return tcptls_session;
 
 error:
@@ -445,7 +448,8 @@
 		return;
 	}
 	
-	desc->old_address = desc->local_address;
+	/* If we return early, there is no one listening */
+	desc->old_address.sin_family = 0;
 	
 	/* Shutdown a running server if there is one */
 	if (desc->master != AST_PTHREADT_NULL) {
@@ -490,6 +494,9 @@
 			strerror(errno));
 		goto error;
 	}
+
+	/* Set current info */
+	desc->old_address = desc->local_address;
 	return;
 
 error:




More information about the svn-commits mailing list