[Asterisk-cvs] asterisk/channels chan_sip.c,1.706,1.707

markster at lists.digium.com markster at lists.digium.com
Wed Apr 27 10:16:37 CDT 2005


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

Modified Files:
	chan_sip.c 
Log Message:
Fix lockup in register timeout


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.706
retrieving revision 1.707
diff -u -d -r1.706 -r1.707
--- chan_sip.c	27 Apr 2005 01:29:28 -0000	1.706
+++ chan_sip.c	27 Apr 2005 15:06:23 -0000	1.707
@@ -1017,8 +1017,19 @@
 /* Pretend to ack all packets */
 static int __sip_pretend_ack(struct sip_pvt *p)
 {
+	char method[128]="";
+	struct sip_pkt *cur=NULL;
+	char *c;
 	while(p->packets) {
-		
+		if (cur == p) {
+			ast_log(LOG_WARNING, "Have a packet that doesn't want to give up!\n");
+			return -1;
+		}
+		cur = p;
+		strncpy(method, p->packets->data, sizeof(method) - 1);
+		c = method;
+		while(*c && (*c < 33)) c++;
+		*c = '\0;;
 		__sip_ack(p, p->packets->seqno, (ast_test_flag(p->packets, FLAG_RESPONSE)), find_sip_method(p->packets->data));
 	}
 	return 0;




More information about the svn-commits mailing list