diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-02 20:13:26 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-02 20:13:26 +0000 |
commit | f0538552eb177e80e8357a7a53c5cee17940c7f0 (patch) | |
tree | add0203819c3e1497c2bb1b3cb73eaf4559e0e75 | |
parent | d53f50c44d459e16b7242db787d5508d1d269c38 (diff) |
Merged revisions 44215 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r44215 | file | 2006-10-02 16:11:02 -0400 (Mon, 02 Oct 2006) | 10 lines
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)
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@44216 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 46d670ca6..21ce89647 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -560,6 +560,7 @@ static enum channelreloadreason sip_reloadreason; /*!< Reason for last rel 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 @@ -14430,7 +14431,7 @@ static void *do_monitor(void *data) /* 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(;;) { @@ -14443,6 +14444,10 @@ static void *do_monitor(void *data) 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); |