[svn-commits] file: branch 1.4 r44215 - in /branches/1.4: ./ channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Oct 2 13:11:02 MST 2006


Author: file
Date: Mon Oct  2 15:11:02 2006
New Revision: 44215

URL: http://svn.digium.com/view/asterisk?rev=44215&view=rev
Log:
Merged revisions 44213 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44213 | file | 2006-10-02 16:07:59 -0400 (Mon, 02 Oct 2006) | 2 lines

Change the fd on the I/O context in case it changed during the reload, which is indeed possible. (issue #7943 reported by eclubb)

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/channels/chan_sip.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?rev=44215&r1=44214&r2=44215&view=diff
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Mon Oct  2 15:11:02 2006
@@ -565,6 +565,7 @@
 
 static struct sched_context *sched;     /*!< The scheduling context */
 static struct io_context *io;           /*!< The IO context */
+static int *sipsock_read_id;            /*!< ID of IO entry for sipsock FD */
 
 #define DEC_CALL_LIMIT	0
 #define INC_CALL_LIMIT	1
@@ -14455,7 +14456,7 @@
 
 	/* Add an I/O event to our SIP UDP socket */
 	if (sipsock > -1) 
-		ast_io_add(io, sipsock, sipsock_read, AST_IO_IN, NULL);
+		sipsock_read_id = ast_io_add(io, sipsock, sipsock_read, AST_IO_IN, NULL);
 	
 	/* From here on out, we die whenever asked */
 	for(;;) {
@@ -14468,6 +14469,10 @@
 			if (option_verbose > 0)
 				ast_verbose(VERBOSE_PREFIX_1 "Reloading SIP\n");
 			sip_do_reload(sip_reloadreason);
+
+			/* Change the I/O fd of our UDP socket */
+			if (sipsock > -1)
+				sipsock_read_id = ast_io_change(io, sipsock_read_id, sipsock, NULL, 0, NULL);
 		}
 		/* Check for interfaces needing to be killed */
 		ast_mutex_lock(&iflock);



More information about the svn-commits mailing list