summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-06-25 10:05:18 +0000
committerBenny Prijono <bennylp@teluu.com>2009-06-25 10:05:18 +0000
commit2a76f00fd086c7969118623e4258ce2daeae2d5c (patch)
tree2d5e60b7c7e69ebce443f90b1a010d1814669232 /pjsip
parent1e63c7c3c410a04720cf22286c9be554ff06f390 (diff)
Ticket #906: Transaction is not destroyed when transport timeout event comes later than transaction timeout (thanks Norma Steveley for the report)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2797 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsip/sip_transaction.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/pjsip/src/pjsip/sip_transaction.c b/pjsip/src/pjsip/sip_transaction.c
index 4ab94632..85fab1f0 100644
--- a/pjsip/src/pjsip/sip_transaction.c
+++ b/pjsip/src/pjsip/sip_transaction.c
@@ -1697,7 +1697,10 @@ static void send_msg_callback( pjsip_send_state *send_state,
tsx->transport = NULL;
}
- if (!*cont) {
+ /* Also stop processing if transaction has been flagged with
+ * pending destroy (http://trac.pjsip.org/repos/ticket/906)
+ */
+ if ((!*cont) || (tsx->transport_flag & TSX_HAS_PENDING_DESTROY)) {
char errmsg[PJ_ERR_MSG_SIZE];
pjsip_status_code sc;
pj_str_t err;
@@ -1733,6 +1736,14 @@ static void send_msg_callback( pjsip_send_state *send_state,
{
tsx_set_state( tsx, PJSIP_TSX_STATE_TERMINATED,
PJSIP_EVENT_TRANSPORT_ERROR, send_state->tdata);
+ }
+ /* Don't forget to destroy if we have pending destroy flag
+ * (http://trac.pjsip.org/repos/ticket/906)
+ */
+ else if (tsx->transport_flag & TSX_HAS_PENDING_DESTROY)
+ {
+ tsx_set_state( tsx, PJSIP_TSX_STATE_DESTROYED,
+ PJSIP_EVENT_TRANSPORT_ERROR, send_state->tdata);
}
} else {