[Asterisk-cvs] asterisk/channels chan_sip.c,1.266,1.267

markster at lists.digium.com markster at lists.digium.com
Sat Jan 10 15:28:11 CST 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv13010/channels

Modified Files:
	chan_sip.c 
Log Message:
Cleanup ACL parsing, handle properly reload on sip with ACL


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.266
retrieving revision 1.267
diff -u -d -r1.266 -r1.267
--- chan_sip.c	9 Jan 2004 06:51:25 -0000	1.266
+++ chan_sip.c	10 Jan 2004 21:19:56 -0000	1.267
@@ -5791,11 +5791,13 @@
 {
 	struct sip_user *user;
 	int format;
+	struct ast_ha *oldha = NULL;
 	user = (struct sip_user *)malloc(sizeof(struct sip_user));
 	if (user) {
 		memset(user, 0, sizeof(struct sip_user));
 		strncpy(user->name, name, sizeof(user->name)-1);
-
+		oldha = user->ha;
+		user->ha = NULL;
 		/* set the usage flag to a sane staring value*/
 		user->inUse = 0;
 		user->outUse = 0;
@@ -5888,6 +5890,8 @@
 		else if (strlen(user->md5secret))
 		        strncpy(user->methods, "md5", sizeof(user->methods) - 1);
 	}
+	if (oldha)
+		ast_free_ha(oldha);
 	return user;
 }
 
@@ -5918,6 +5922,7 @@
 {
 	struct sip_peer *peer;
 	struct sip_peer *prev;
+	struct ast_ha *oldha = NULL;
 	int maskfound=0;
 	int format;
 	int found=0;
@@ -5955,6 +5960,8 @@
 			peer->addr.sin_port = htons(DEFAULT_SIP_PORT);
 			peer->expiry = expiry;
 		}
+		oldha = peer->ha;
+		peer->ha = NULL;
 		peer->capability = capability;
 		/* Assume can reinvite */
 		peer->canreinvite = REINVITE_INVITE;
@@ -6075,6 +6082,8 @@
 			reg_source_db(peer);
 		peer->delme = 0;
 	}
+	if (oldha)
+		ast_free_ha(oldha);
 	return peer;
 }
 




More information about the svn-commits mailing list