[asterisk-commits] murf: branch murf/bug11210 r113592 - /team/murf/bug11210/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 8 18:40:23 CDT 2008


Author: murf
Date: Tue Apr  8 18:40:23 2008
New Revision: 113592

URL: http://svn.digium.com/view/asterisk?view=rev&rev=113592
Log:
Found the issue that killed SIP responding to input. My bad on an svnmerge. I didn't resolve what to do if you traverse the set, and delete elements as you go. The old way restarted the traversal with each deletion. I foolishly tried to replicate this. No more.

Modified:
    team/murf/bug11210/channels/chan_sip.c

Modified: team/murf/bug11210/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug11210/channels/chan_sip.c?view=diff&rev=113592&r1=113591&r2=113592
==============================================================================
--- team/murf/bug11210/channels/chan_sip.c (original)
+++ team/murf/bug11210/channels/chan_sip.c Tue Apr  8 18:40:23 2008
@@ -19296,7 +19296,7 @@
 	/* Add an I/O event to our SIP UDP socket */
 	if (sipsock > -1) 
 		sipsock_read_id = ast_io_add(io, sipsock, sipsock_read, AST_IO_IN, NULL);
-	
+
 	/* From here on out, we die whenever asked */
 	for(;;) {
 		/* Check for a reload request */
@@ -19321,7 +19321,6 @@
 		}
 
 		/* Check for dialogs needing to be killed */
-	  restartsearch:
 		t = time(NULL);
 		/* don't scan the dialogs list if it hasn't been a reasonable period
 		   of time since the last time we did it (when MWI is being sent, we can
@@ -19330,8 +19329,9 @@
 
 		ao2_t_callback(dialogs, OBJ_UNLINK|OBJ_NODATA, dialog_needdestroy, &t, "callback to remove dialogs w/needdestroy");
 
-		if (ao2_container_count(dialogs) != 0)
-			goto restartsearch;
+		/* the old methodology would be to restart the search for dialogs to delete with every 
+		   dialog that was found and destroyed, probably because the list contents would change,
+		   so we'd need to restart. This isn't the best thing to do with callbacks. */
 
 		pthread_testcancel();
 		/* Wait for sched or io */




More information about the asterisk-commits mailing list