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: https://svn.pjsip.org/repos/pjproject/trunk@1551 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Benny Prijono 2007-11-05 23:25:37 +00:00
parent 42307c7b79
commit 8dbd8637e8
1 changed files with 3 additions and 0 deletions

View File

@ -1078,6 +1078,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(&tcp->base, tdata_op_key->token, bytes_sent);
/* Mark last activity time */