Changeset 2661 for pjproject/trunk/pjsip/src/pjsip-simple/publishc.c
- Timestamp:
- Apr 28, 2009 10:19:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-simple/publishc.c
r2394 r2661 82 82 pj_uint32_t expires; 83 83 pjsip_route_hdr route_set; 84 pjsip_hdr usr_hdr; 84 85 85 86 /* Authorization sessions. */ … … 158 159 159 160 pj_list_init(&pubc->route_set); 161 pj_list_init(&pubc->usr_hdr); 160 162 161 163 /* Done */ … … 187 189 static void set_expires( pjsip_publishc *pubc, pj_uint32_t expires) 188 190 { 189 if (expires != pubc->expires) { 191 if (expires != pubc->expires && 192 expires != PJSIP_PUBC_EXPIRATION_NOT_SPECIFIED) 193 { 190 194 pubc->expires_hdr = pjsip_expires_hdr_create(pubc->pool, expires); 191 195 } else { … … 277 281 pj_list_push_back(&pubc->route_set, pjsip_hdr_clone(pubc->pool, chdr)); 278 282 chdr = chdr->next; 283 } 284 285 return PJ_SUCCESS; 286 } 287 288 PJ_DEF(pj_status_t) pjsip_publishc_set_headers( pjsip_publishc *pubc, 289 const pjsip_hdr *hdr_list) 290 { 291 const pjsip_hdr *h; 292 293 PJ_ASSERT_RETURN(pubc && hdr_list, PJ_EINVAL); 294 295 pj_list_init(&pubc->usr_hdr); 296 h = hdr_list->next; 297 while (h != hdr_list) { 298 pj_list_push_back(&pubc->usr_hdr, pjsip_hdr_clone(pubc->pool, h)); 299 h = h->next; 279 300 } 280 301 … … 346 367 } 347 368 369 /* Add user headers */ 370 if (!pj_list_empty(&pubc->usr_hdr)) { 371 const pjsip_hdr *hdr; 372 373 hdr = pubc->usr_hdr.next; 374 while (hdr != &pubc->usr_hdr) { 375 pjsip_hdr *new_hdr = (pjsip_hdr*) 376 pjsip_hdr_shallow_clone(tdata->pool, hdr); 377 pjsip_msg_add_hdr(tdata->msg, new_hdr); 378 hdr = hdr->next; 379 } 380 } 381 348 382 349 383 /* Done. */ … … 531 565 pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL); 532 566 533 if ( expires)567 if (pubc->auto_refresh && expires) 534 568 expiration = expires->ivalue; 535 569
Note: See TracChangeset
for help on using the changeset viewer.