- Timestamp:
- Dec 28, 2016 3:40:07 AM (8 years ago)
- Location:
- pjproject/branches/projects/uwp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/uwp
- Property svn:mergeinfo changed
/pjproject/trunk (added) merged: 5209,5212-5234,5237-5253,5255,5257-5292,5294-5297,5299-5332,5334-5394,5396-5438,5440-5469,5471-5496,5498-5510
- Property svn:mergeinfo changed
-
pjproject/branches/projects/uwp/pjsip/src/pjsip-ua/sip_reg.c
r4989 r5513 190 190 pj_lock_destroy(regc->lock); 191 191 regc->lock = NULL; 192 193 pjsip_auth_clt_deinit(®c->auth_sess); 192 194 pjsip_endpt_release_pool(regc->endpt, regc->pool); 193 195 } … … 514 516 while (route != ®c->route_set) { 515 517 pjsip_hdr *new_hdr = (pjsip_hdr*) 516 pjsip_hdr_ shallow_clone(tdata->pool, route);518 pjsip_hdr_clone(tdata->pool, route); 517 519 pj_list_insert_after(route_pos, new_hdr); 518 520 route_pos = new_hdr; … … 528 530 while (hdr != ®c->hdr_list) { 529 531 pjsip_hdr *new_hdr = (pjsip_hdr*) 530 pjsip_hdr_ shallow_clone(tdata->pool, hdr);532 pjsip_hdr_clone(tdata->pool, hdr); 531 533 pjsip_msg_add_hdr(tdata->msg, new_hdr); 532 534 hdr = hdr->next; … … 567 569 while (hdr != ®c->contact_hdr_list) { 568 570 pjsip_msg_add_hdr(msg, (pjsip_hdr*) 569 pjsip_hdr_ shallow_clone(tdata->pool, hdr));571 pjsip_hdr_clone(tdata->pool, hdr)); 570 572 hdr = hdr->next; 571 573 } … … 582 584 if (regc->expires_hdr) 583 585 pjsip_msg_add_hdr(msg, (pjsip_hdr*) 584 pjsip_hdr_ shallow_clone(tdata->pool,585 586 pjsip_hdr_clone(tdata->pool, 587 regc->expires_hdr)); 586 588 587 589 if (regc->timer.id != 0) { … … 594 596 if (h_allow) { 595 597 pjsip_msg_add_hdr(msg, (pjsip_hdr*) 596 pjsip_hdr_ shallow_clone(tdata->pool, h_allow));598 pjsip_hdr_clone(tdata->pool, h_allow)); 597 599 598 600 } … … 639 641 while ((void*)hdr != (void*)®c->contact_hdr_list) { 640 642 pjsip_msg_add_hdr(msg, (pjsip_hdr*) 641 pjsip_hdr_ shallow_clone(tdata->pool, hdr));643 pjsip_hdr_clone(tdata->pool, hdr)); 642 644 hdr = hdr->next; 643 645 } … … 739 741 const pj_str_t *reason, 740 742 pjsip_rx_data *rdata, pj_int32_t expiration, 741 int contact_cnt, pjsip_contact_hdr *contact[]) 743 int contact_cnt, pjsip_contact_hdr *contact[], 744 pj_bool_t is_unreg) 742 745 { 743 746 cbparam->regc = regc; … … 750 753 cbparam->expiration = (expiration >= 0? expiration: 751 754 regc->expires_requested); 755 cbparam->is_unreg = is_unreg; 752 756 if (contact_cnt) { 753 757 pj_memcpy( cbparam->contact, contact, … … 759 763 const pj_str_t *reason, 760 764 pjsip_rx_data *rdata, pj_int32_t expiration, 761 int contact_cnt, pjsip_contact_hdr *contact[]) 765 int contact_cnt, pjsip_contact_hdr *contact[], 766 pj_bool_t is_unreg) 762 767 { 763 768 struct pjsip_regc_cbparam cbparam; … … 767 772 768 773 cbparam_init(&cbparam, regc, status, st_code, reason, rdata, expiration, 769 contact_cnt, contact );774 contact_cnt, contact, is_unreg); 770 775 (*regc->cb)(&cbparam); 771 776 } … … 794 799 char errmsg[PJ_ERR_MSG_SIZE]; 795 800 pj_str_t reason = pj_strerror(status, errmsg, sizeof(errmsg)); 796 call_callback(regc, status, 400, &reason, NULL, -1, 0, NULL); 801 call_callback(regc, status, 400, &reason, NULL, -1, 0, NULL, 802 PJ_FALSE); 797 803 } 798 804 … … 1092 1098 (event->body.tsx_state.type==PJSIP_EVENT_RX_MSG) ? 1093 1099 event->body.tsx_state.src.rdata : NULL, 1094 -1, 0, NULL );1100 -1, 0, NULL, PJ_FALSE); 1095 1101 1096 1102 /* Call regc tsx callback before handling any response */ … … 1131 1137 pjsip_rx_data *rdata = event->body.tsx_state.src.rdata; 1132 1138 pjsip_tx_data *tdata; 1139 pj_bool_t is_unreg; 1133 1140 1134 1141 /* reset current op */ 1142 is_unreg = (regc->current_op == REGC_UNREGISTERING); 1135 1143 regc->current_op = REGC_IDLE; 1136 1144 … … 1164 1172 while (chdr != ®c->contact_hdr_list) { 1165 1173 pj_list_insert_before(ins_hdr, (pjsip_hdr*) 1166 pjsip_hdr_ shallow_clone(tsx->last_tx->pool, chdr));1174 pjsip_hdr_clone(tsx->last_tx->pool, chdr)); 1167 1175 chdr = chdr->next; 1168 1176 } … … 1198 1206 call_callback(regc, status, tsx->status_code, 1199 1207 &rdata->msg_info.msg->line.status.reason, 1200 rdata, -1, 0, NULL );1208 rdata, -1, 0, NULL, is_unreg); 1201 1209 pj_lock_acquire(regc->lock); 1202 1210 } … … 1287 1295 call_callback(regc, status, tsx->status_code, 1288 1296 &rdata->msg_info.msg->line.status.reason, 1289 rdata, -1, 0, NULL );1297 rdata, -1, 0, NULL, PJ_FALSE); 1290 1298 pj_lock_acquire(regc->lock); 1291 1299 } … … 1302 1310 unsigned contact_cnt = 0; 1303 1311 pjsip_contact_hdr *contact[PJSIP_REGC_MAX_CONTACT]; 1312 pj_bool_t is_unreg; 1304 1313 1305 1314 if (tsx->status_code/100 == 2) { … … 1326 1335 1327 1336 /* Mark operation as complete */ 1337 is_unreg = (regc->current_op == REGC_UNREGISTERING); 1328 1338 regc->current_op = REGC_IDLE; 1329 1339 … … 1337 1347 : &tsx->status_text), 1338 1348 rdata, expiration, 1339 contact_cnt, contact );1349 contact_cnt, contact, is_unreg); 1340 1350 pj_lock_acquire(regc->lock); 1341 1351 } … … 1425 1435 regc, ®c_tsx_callback); 1426 1436 if (status!=PJ_SUCCESS) { 1437 /* On failure, regc_tsx_callback() may not be called, so we need 1438 * to reset regc->has_tsx here (see also ticket #1936). 1439 */ 1440 regc->has_tsx = PJ_FALSE; 1441 1427 1442 PJ_LOG(4,(THIS_FILE, "Error sending request, status=%d", status)); 1428 1443 }
Note: See TracChangeset
for help on using the changeset viewer.