Changeset 4530 for pjproject/trunk/pjsip/src/pjsip-simple/publishc.c
- Timestamp:
- May 30, 2013 9:27:49 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-simple/publishc.c
r4206 r4530 62 62 typedef struct pending_publish 63 63 { 64 PJ_DECL_LIST_MEMBER(pjsip_tx_data); 64 PJ_DECL_LIST_MEMBER(struct pending_publish); 65 pjsip_tx_data *tdata; 65 66 } pending_publish; 66 67 … … 109 110 /* Pending PUBLISH request */ 110 111 pending_publish pending_reqs; 112 pending_publish pending_reqs_empty; 111 113 }; 112 114 … … 181 183 pj_memcpy(&pubc->opt, opt, sizeof(*opt)); 182 184 pj_list_init(&pubc->pending_reqs); 185 pj_list_init(&pubc->pending_reqs_empty); 183 186 184 187 status = pj_mutex_create_recursive(pubc->pool, "pubc%p", &pubc->mutex); … … 684 687 pj_mutex_lock(pubc->mutex); 685 688 while (!pj_list_empty(&pubc->pending_reqs)) { 686 pjsip_tx_data *tdata = pubc->pending_reqs.next; 687 pj_list_erase(tdata); 689 pending_publish *pp = pubc->pending_reqs.next; 690 pjsip_tx_data *tdata = pp->tdata; 691 692 /* Remove the request from pending request list, 693 * and keep the unused entry into pending_reqs_empty pool. 694 */ 695 pj_list_erase(pp); 696 pj_list_push_back(&pubc->pending_reqs_empty, pp); 688 697 689 698 /* Add SIP-If-Match if we have etag and the request doesn't have … … 713 722 if (status == PJ_EPENDING) { 714 723 pj_assert(!"Not expected"); 715 pj_list_erase(tdata);716 724 pjsip_tx_data_dec_ref(tdata); 717 725 } else if (status == PJ_SUCCESS) { … … 745 753 if (pubc->pending_tsx) { 746 754 if (pubc->opt.queue_request) { 747 pj_list_push_back(&pubc->pending_reqs, tdata); 755 pending_publish *pp = NULL; 756 if (pj_list_empty(&pubc->pending_reqs_empty)) { 757 pp = PJ_POOL_ZALLOC_T(pubc->pool, pending_publish); 758 } else { 759 pp = pubc->pending_reqs_empty.next; 760 pj_list_erase(pp); 761 } 762 pp->tdata = tdata; 763 pj_list_push_back(&pubc->pending_reqs, pp); 748 764 pj_mutex_unlock(pubc->mutex); 749 765 PJ_LOG(4,(THIS_FILE, "Request is queued, pubc has another "
Note: See TracChangeset
for help on using the changeset viewer.