diff options
author | Benny Prijono <bennylp@teluu.com> | 2013-03-05 11:59:54 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2013-03-05 11:59:54 +0000 |
commit | 22da209226aac2c65f45900e55cf5f162cd311d4 (patch) | |
tree | 6ab301e7c4b749be0683e50760c8b50da1c9e5e2 /pjsip/src/test/tsx_uac_test.c | |
parent | 1f3242dc1324388f45e1ed939d7656352dd92f7e (diff) |
Implementation of Re #1628: Modify SIP transaction to use group lock to avoid deadlock etc.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4420 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/test/tsx_uac_test.c')
-rw-r--r-- | pjsip/src/test/tsx_uac_test.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pjsip/src/test/tsx_uac_test.c b/pjsip/src/test/tsx_uac_test.c index 0677da18..d978df80 100644 --- a/pjsip/src/test/tsx_uac_test.c +++ b/pjsip/src/test/tsx_uac_test.c @@ -220,10 +220,13 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e) if (tsx->state == PJSIP_TSX_STATE_TERMINATED) { /* Test the status code. */ - if (tsx->status_code != PJSIP_SC_TSX_TRANSPORT_ERROR) { + if (tsx->status_code != PJSIP_SC_TSX_TRANSPORT_ERROR && + tsx->status_code != PJSIP_SC_BAD_GATEWAY) + { PJ_LOG(3,(THIS_FILE, - " error: status code is %d instead of %d", - tsx->status_code, PJSIP_SC_TSX_TRANSPORT_ERROR)); + " error: status code is %d instead of %d or %d", + tsx->status_code, PJSIP_SC_TSX_TRANSPORT_ERROR, + PJSIP_SC_BAD_GATEWAY)); test_complete = -720; } @@ -688,7 +691,7 @@ static pj_bool_t msg_receiver_on_rx_request(pjsip_rx_data *rdata) tsx = pjsip_tsx_layer_find_tsx(&key, PJ_TRUE); if (tsx) { pjsip_tsx_terminate(tsx, PJSIP_SC_REQUEST_TERMINATED); - pj_mutex_unlock(tsx->mutex); + pj_grp_lock_release(tsx->grp_lock); } else { PJ_LOG(3,(THIS_FILE, " error: uac transaction not found!")); test_complete = -633; @@ -1027,7 +1030,7 @@ static int perform_tsx_test(int dummy, char *target_uri, char *from_uri, tsx = pjsip_tsx_layer_find_tsx(&tsx_key, PJ_TRUE); if (tsx) { pjsip_tsx_terminate(tsx, PJSIP_SC_REQUEST_TERMINATED); - pj_mutex_unlock(tsx->mutex); + pj_grp_lock_release(tsx->grp_lock); flush_events(1000); } pjsip_tx_data_dec_ref(tdata); |