Changeset 3412 for pjproject/trunk/pjsip/src/pjsip-simple/evsub.c
- Timestamp:
- Feb 11, 2011 7:39:14 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-simple/evsub.c
r3341 r3412 228 228 pjsip_expires_hdr *expires; /**< Expires header */ 229 229 pjsip_accept_hdr *accept; /**< Local Accept header. */ 230 pjsip_hdr sub_hdr_list; /**< User-defined header. */ 230 231 231 232 pj_time_val refresh_time; /**< Time to refresh. */ … … 724 725 sub->accept = (pjsip_accept_hdr*) 725 726 pjsip_hdr_clone(sub->pool, pkg->pkg_accept); 727 pj_list_init(&sub->sub_hdr_list); 726 728 727 729 sub->timer.user_data = sub; … … 1028 1030 mod_evsub.allow_events_hdr)); 1029 1031 1030 1032 1033 /* Add custom headers */ 1034 { 1035 const pjsip_hdr *hdr = sub->sub_hdr_list.next; 1036 while (hdr != &sub->sub_hdr_list) { 1037 pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*) 1038 pjsip_hdr_shallow_clone(tdata->pool, hdr)); 1039 hdr = hdr->next; 1040 } 1041 } 1042 1043 1031 1044 *p_tdata = tdata; 1032 1045 … … 1036 1049 pjsip_dlg_dec_lock(sub->dlg); 1037 1050 return status; 1051 } 1052 1053 1054 /* 1055 * Add custom headers. 1056 */ 1057 PJ_DEF(pj_status_t) pjsip_evsub_add_header( pjsip_evsub *sub, 1058 const pjsip_hdr *hdr_list ) 1059 { 1060 const pjsip_hdr *hdr; 1061 1062 PJ_ASSERT_RETURN(sub && hdr_list, PJ_EINVAL); 1063 1064 hdr = hdr_list->next; 1065 while (hdr != hdr_list) { 1066 pj_list_push_back(&sub->sub_hdr_list, (pjsip_hdr*) 1067 pjsip_hdr_clone(sub->pool, hdr)); 1068 hdr = hdr->next; 1069 } 1070 1071 return PJ_SUCCESS; 1038 1072 } 1039 1073
Note: See TracChangeset
for help on using the changeset viewer.