Changeset 5178 for pjproject/trunk/pjsip/src/pjsip-simple/evsub.c
- Timestamp:
- Sep 11, 2015 9:44:52 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-simple/evsub.c
r5177 r5178 236 236 pjsip_transaction *pending_sub; /**< Pending UAC SUBSCRIBE tsx. */ 237 237 pj_timer_entry *pending_sub_timer; /**< Stop pending sub timer. */ 238 pj_grp_lock_t *grp_lock; /* Session group lock */ 238 239 239 240 void *mod_data[PJSIP_MAX_MODULE]; /**< Module data. */ … … 515 516 timeout.sec = seconds; 516 517 timeout.msec = 0; 517 sub->timer.id = timer_id; 518 519 pjsip_endpt_schedule_timer(sub->endpt, &sub->timer, &timeout); 518 519 pj_timer_heap_schedule_w_grp_lock( 520 pjsip_endpt_get_timer_heap(sub->endpt), 521 &sub->timer, &timeout, timer_id, sub->grp_lock); 520 522 521 523 PJ_LOG(5,(sub->obj_name, "Timer %s scheduled in %d seconds", 522 524 timer_names[sub->timer.id], timeout.sec)); 523 525 } 526 } 527 528 529 /* 530 * Destructor. 531 */ 532 static void evsub_on_destroy(void *obj) 533 { 534 pjsip_evsub *sub = (pjsip_evsub*)obj; 535 536 /* Decrement dialog's session */ 537 pjsip_dlg_dec_session(sub->dlg, &mod_evsub.mod); 524 538 } 525 539 … … 557 571 } 558 572 559 /* Decrement dialog's session */ 560 pjsip_dlg_dec_session(sub->dlg, &mod_evsub.mod); 573 pj_grp_lock_dec_ref(sub->grp_lock); 561 574 } 562 575 … … 849 862 pjsip_dlg_inc_session(sub->dlg, &mod_evsub.mod); 850 863 864 /* Init group lock */ 865 status = pj_grp_lock_create(dlg->pool, NULL, &sub->grp_lock); 866 if (status != PJ_SUCCESS) { 867 pjsip_dlg_dec_session(sub->dlg, &mod_evsub.mod); 868 goto on_return; 869 } 870 871 pj_grp_lock_add_ref(sub->grp_lock); 872 pj_grp_lock_add_handler(sub->grp_lock, dlg->pool, sub, &evsub_on_destroy); 873 851 874 /* Done */ 852 875 *p_evsub = sub; … … 938 961 sub->accept = (pjsip_accept_hdr*)pjsip_hdr_clone(sub->pool,accept_hdr); 939 962 963 /* Increment dlg session. */ 964 pjsip_dlg_inc_session(dlg, &mod_evsub.mod); 965 966 /* Init group lock */ 967 status = pj_grp_lock_create(dlg->pool, NULL, &sub->grp_lock); 968 if (status != PJ_SUCCESS) { 969 pjsip_dlg_dec_session(sub->dlg, &mod_evsub.mod); 970 goto on_return; 971 } 972 973 pj_grp_lock_add_ref(sub->grp_lock); 974 pj_grp_lock_add_handler(sub->grp_lock, dlg->pool, sub, &evsub_on_destroy); 975 940 976 /* We can start the session: */ 941 977 942 pjsip_dlg_inc_session(dlg, &mod_evsub.mod);943 978 sub->pending_tsx++; 944 979 tsx->mod_data[mod_evsub.mod.id] = sub; 945 946 980 947 981 /* Done. */
Note: See TracChangeset
for help on using the changeset viewer.