aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-20 11:29:19 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-20 11:29:19 +0000
commit7b0d451eb65cf15647eb50ca14a500a1ceb9b28f (patch)
tree10078a93fef8d8e4a1e58dc72243a80085a3dc9c /channels
parenta618e583f2d95f5478636009086b56faa96cd81c (diff)
Make sure we destroy scheduled items and not use them ever again after destruction (rizzo)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47843 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a81fbb7ab..89e52342a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2038,6 +2038,7 @@ static void __sip_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod)
if (sipdebug && option_debug > 3)
ast_log(LOG_DEBUG, "** SIP TIMER: Cancelling retransmit of packet (reply received) Retransid #%d\n", cur->retransid);
ast_sched_del(sched, cur->retransid);
+ cur->retransid = -1;
}
free(cur);
break;
@@ -2080,8 +2081,8 @@ static int __sip_semi_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod)
if (option_debug > 3 && sipdebug)
ast_log(LOG_DEBUG, "*** SIP TIMER: Cancelling retransmission #%d - %s (got response)\n", cur->retransid, sip_methods[sipmethod].text);
ast_sched_del(sched, cur->retransid);
+ cur->retransid = -1;
}
- cur->retransid = -1;
res = 0;
break;
}
@@ -2330,6 +2331,7 @@ static void sip_destroy_peer(struct sip_peer *peer)
}
if (peer->expire > -1)
ast_sched_del(sched, peer->expire);
+
if (peer->pokeexpire > -1)
ast_sched_del(sched, peer->pokeexpire);
register_peer_exten(peer, FALSE);
@@ -7717,8 +7719,10 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
else
peer->username[0] = '\0';
- if (peer->expire > -1)
+ if (peer->expire > -1) {
ast_sched_del(sched, peer->expire);
+ peer->expire = -1;
+ }
if (expiry > max_expiry)
expiry = max_expiry;
if (expiry < min_expiry)
@@ -11783,6 +11787,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
if (global_regattempts_max)
p->registry->regattempts = global_regattempts_max+1;
ast_sched_del(sched, r->timeout);
+ r->timeout = -1;
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
break;
case 404: /* Not found */
@@ -11792,6 +11797,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
r->call = NULL;
ast_sched_del(sched, r->timeout);
+ r->timeout = -1;
break;
case 407: /* Proxy auth */
if ((p->authtries == MAX_AUTHTRIES) || do_register_auth(p, req, "Proxy-Authenticate", "Proxy-Authorization")) {
@@ -11806,6 +11812,7 @@ static int handle_response_register(struct sip_pvt *p, int resp, char *rest, str
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
r->call = NULL;
ast_sched_del(sched, r->timeout);
+ r->timeout = -1;
break;
case 200: /* 200 OK */
if (!r) {