Changeset 160 for pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
- Timestamp:
- Feb 8, 2006 10:44:25 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r152 r160 171 171 static int tsx_send_msg( pjsip_transaction *tsx, 172 172 pjsip_tx_data *tdata); 173 static void tsx_on_rx_msg( pjsip_transaction *tsx,174 pjsip_rx_data *rdata );175 173 176 174 … … 698 696 /* Race condition! 699 697 * Transaction may gets deleted before we have chance to lock it 700 * in tsx_on_rx_msg().698 * in pjsip_tsx_recv_msg(). 701 699 */ 702 700 PJ_TODO(FIX_RACE_CONDITION_HERE); 703 701 704 702 /* Pass the message to the transaction. */ 705 tsx_on_rx_msg(tsx, rdata );703 pjsip_tsx_recv_msg(tsx, rdata ); 706 704 707 705 return PJ_TRUE; … … 746 744 /* Race condition! 747 745 * Transaction may gets deleted before we have chance to lock it 748 * in tsx_on_rx_msg().746 * in pjsip_tsx_recv_msg(). 749 747 */ 750 748 PJ_TODO(FIX_RACE_CONDITION_HERE); 751 749 752 750 /* Pass the message to the transaction. */ 753 tsx_on_rx_msg(tsx, rdata );751 pjsip_tsx_recv_msg(tsx, rdata ); 754 752 755 753 return PJ_TRUE; … … 966 964 pj_assert(rdata != NULL); 967 965 968 if (rdata->msg_info.msg->type == PJSIP_REQUEST_MSG && 969 tsx->tsx_user->on_rx_request) 970 { 971 (*tsx->tsx_user->on_rx_request)(rdata); 972 973 } else if (rdata->msg_info.msg->type == PJSIP_RESPONSE_MSG && 966 if (rdata->msg_info.msg->type == PJSIP_RESPONSE_MSG && 974 967 tsx->tsx_user->on_rx_response) 975 968 { … … 1240 1233 1241 1234 1242 /* Begin with state TRYING.1235 /* Begin with state NULL. 1243 1236 * Manually set-up the state becase we don't want to call the callback. 1244 1237 */ 1245 tsx->state = PJSIP_TSX_STATE_ TRYING;1246 tsx->state_handler = &tsx_on_state_ trying;1238 tsx->state = PJSIP_TSX_STATE_NULL; 1239 tsx->state_handler = &tsx_on_state_null; 1247 1240 1248 1241 /* Get response address. */ … … 1328 1321 state_str[tsx->state])); 1329 1322 1330 PJSIP_EVENT_INIT_TX_MSG(event, t sx, tdata);1323 PJSIP_EVENT_INIT_TX_MSG(event, tdata); 1331 1324 1332 1325 /* Dispatch to transaction. */ … … 1350 1343 * transaction is received. 1351 1344 */ 1352 static void tsx_on_rx_msg( pjsip_transaction *tsx, pjsip_rx_data *rdata) 1345 PJ_DEF(void) pjsip_tsx_recv_msg( pjsip_transaction *tsx, 1346 pjsip_rx_data *rdata) 1353 1347 { 1354 1348 pjsip_event event; … … 1363 1357 1364 1358 /* Init event. */ 1365 PJSIP_EVENT_INIT_RX_MSG(event, tsx,rdata);1359 PJSIP_EVENT_INIT_RX_MSG(event, rdata); 1366 1360 1367 1361 /* Dispatch to transaction. */ … … 1717 1711 if (tsx->role == PJSIP_ROLE_UAS) { 1718 1712 1719 /* UAS doesn't have STATE_NULL. 1720 * State has moved from NULL after transaction is initialized. 1721 */ 1722 pj_assert(!"Bug bug bug!!"); 1723 return PJ_EBUG; 1713 /* Set state to Trying. */ 1714 pj_assert(event->type == PJSIP_EVENT_RX_MSG && 1715 event->body.rx_msg.rdata->msg_info.msg->type == 1716 PJSIP_REQUEST_MSG); 1717 tsx_set_state( tsx, PJSIP_TSX_STATE_TRYING, PJSIP_EVENT_RX_MSG, 1718 event->body.rx_msg.rdata); 1724 1719 1725 1720 } else {
Note: See TracChangeset
for help on using the changeset viewer.