[Asterisk-cvs] asterisk/channels chan_sip.c,1.185,1.186

markster at lists.digium.com markster at lists.digium.com
Tue Sep 30 23:42:32 CDT 2003


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

Modified Files:
	chan_sip.c 
Log Message:
Fix leaking sip channels


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -d -r1.185 -r1.186
--- chan_sip.c	1 Oct 2003 03:03:42 -0000	1.185
+++ chan_sip.c	1 Oct 2003 04:43:43 -0000	1.186
@@ -4079,7 +4079,7 @@
 static int sip_show_channels(int fd, int argc, char *argv[])
 {
 #define FORMAT2 "%-15.15s  %-10.10s  %-11.11s  %-11.11s  %-7.7s  %-6.6s  %s\n"
-#define FORMAT  "%-15.15s  %-10.10s  %-11.11s  %5.5d/%5.5d  %-5.5dms  %-4.4dms  %-6.6s\n"
+#define FORMAT  "%-15.15s  %-10.10s  %-11.11s  %5.5d/%5.5d  %-5.5dms  %-4.4dms  %-6.6s%s\n"
 	struct sip_pvt *cur;
 	int numchans = 0;
 	if (argc != 3)
@@ -4095,7 +4095,7 @@
 						cur->ocseq, cur->icseq, 
 						0,
 						0,
-						ast_getformatname(cur->owner ? cur->owner->nativeformats : 0) );
+						ast_getformatname(cur->owner ? cur->owner->nativeformats : 0), cur->needdestroy ? "(d)" : "" );
 		numchans++;
 		}
 		cur = cur->next;
@@ -5278,7 +5278,7 @@
 		sip = iflist;
 		while(sip) {
 			ast_mutex_lock(&sip->lock);
-			if (sip->needdestroy && !sip->packets) {
+			if (sip->needdestroy && (!sip->packets || (sip->packets->retransid == -1))) {
 				ast_mutex_unlock(&sip->lock);
 				__sip_destroy(sip, 1);
 				goto restartsearch;




More information about the svn-commits mailing list