summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-11-05 23:30:40 +0000
committerBenny Prijono <bennylp@teluu.com>2007-11-05 23:30:40 +0000
commitda7bae2d171749429799d059ae3951416f756b8b (patch)
tree276b5d91e4db3e28a9a8327bbe315691199b1e39
parent156648a692cd9147563c4983bf41699d25402f50 (diff)
SIP TCP and TLS transports may call send completion callback with bytes_set=0 when send operation fails because outgoing connection is cancelled (for example, application quits). This will trigger assertion error in transaction because transaction only expects positive or negative bytes_set number, but not zero
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1552 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsip/sip_transport_tls_ossl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pjsip/src/pjsip/sip_transport_tls_ossl.c b/pjsip/src/pjsip/sip_transport_tls_ossl.c
index db159148..e1c11a86 100644
--- a/pjsip/src/pjsip/sip_transport_tls_ossl.c
+++ b/pjsip/src/pjsip/sip_transport_tls_ossl.c
@@ -1822,6 +1822,9 @@ static void on_write_complete(pj_ioqueue_key_t *key,
/*
* Notify sip_transport.c that packet has been sent.
*/
+ if (bytes_sent == 0)
+ bytes_sent = -PJ_RETURN_OS_ERROR(OSERR_ENOTCONN);
+
tdata_op_key->callback(&tls->base, tdata_op_key->token, bytes_sent);
}
}