diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2013-03-22 08:28:42 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2013-03-22 08:28:42 +0000 |
commit | 73b863fc42f7fd6dfd636a3c1e366da92f23d4c9 (patch) | |
tree | 8fb0984d2b3d6570edbdda050ed01fcde49abefc /pjsip | |
parent | 01c5a3ea27dc37d11ee6b9583d40c176031f1ff5 (diff) |
Fix #1649: Invoke SIP TLS transport callback when transport is shutdown by TLS certificate verification error.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4450 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/src/pjsip/sip_transport_tls.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/pjsip/src/pjsip/sip_transport_tls.c b/pjsip/src/pjsip/sip_transport_tls.c index 1f7c0dee..2e703c6b 100644 --- a/pjsip/src/pjsip/sip_transport_tls.c +++ b/pjsip/src/pjsip/sip_transport_tls.c @@ -1580,8 +1580,25 @@ static pj_bool_t on_connect_complete(pj_ssl_sock_t *ssock, */ is_shutdown = tls->base.is_shutdown; pjsip_transport_dec_ref(&tls->base); - if (is_shutdown) + if (is_shutdown) { + status = tls->close_reason; + tls_perror(tls->base.obj_name, "TLS connect() error", status); + + /* Cancel all delayed transmits */ + while (!pj_list_empty(&tls->delayed_list)) { + struct delayed_tdata *pending_tx; + pj_ioqueue_op_key_t *op_key; + + pending_tx = tls->delayed_list.next; + pj_list_erase(pending_tx); + + op_key = (pj_ioqueue_op_key_t*)pending_tx->tdata_op_key; + + on_data_sent(tls->ssock, op_key, -status); + } + return PJ_FALSE; + } /* Mark that pending connect() operation has completed. */ |