Changeset 3340 for pjproject/trunk
- Timestamp:
- Oct 13, 2010 9:41:37 AM (14 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/sip_msg.h
r3241 r3340 547 547 * @param mt1 The first media type. 548 548 * @param mt2 The second media type. 549 * @param cmp_param Specify how to compare the media type parameters: 550 * - 0: do not compare parameters 551 * - 1: compare parameters but ignore parameters that 552 * only appear in one of the media type. 553 * - 2: compare the parameters. 549 554 * 550 555 * @return Zero if both media types are equal, -1 if mt1 < mt2, … … 552 557 */ 553 558 PJ_DECL(int) pjsip_media_type_cmp(const pjsip_media_type *mt1, 554 const pjsip_media_type *mt2); 559 const pjsip_media_type *mt2, 560 int cmp_param); 555 561 556 562 /** -
pjproject/trunk/pjsip/src/pjsip/sip_msg.c
r3301 r3340 646 646 */ 647 647 PJ_DEF(int) pjsip_media_type_cmp( const pjsip_media_type *mt1, 648 const pjsip_media_type *mt2) 648 const pjsip_media_type *mt2, 649 pj_bool_t cmp_param) 649 650 { 650 651 int rc; … … 658 659 if (rc) return rc; 659 660 660 rc = pjsip_param_cmp(&mt1->param, &mt2->param, 0); 661 if (cmp_param) { 662 rc = pjsip_param_cmp(&mt1->param, &mt2->param, (cmp_param==1)); 663 } 661 664 662 665 return rc; -
pjproject/trunk/pjsip/src/pjsip/sip_multipart.c
r3255 r3340 397 397 398 398 while (part != &m_data->part_head) { 399 if (pjsip_media_type_cmp(&part->body->content_type, content_type)==0) 399 if (pjsip_media_type_cmp(&part->body->content_type, 400 content_type, 0)==0) 401 { 400 402 return part; 403 } 401 404 part = part->next; 402 405 } -
pjproject/trunk/pjsip/src/pjsip/sip_parser.c
r3243 r3340 1857 1857 while (*scanner->curptr == ';') { 1858 1858 pjsip_param *param = PJ_POOL_ALLOC_T(ctx->pool, pjsip_param); 1859 int_parse_param(scanner, ctx->pool, ¶m->name, ¶m->value, 0); 1859 int_parse_param(scanner, ctx->pool, ¶m->name, ¶m->value, 1860 PJSIP_PARSE_REMOVE_QUOTE); 1860 1861 pj_list_push_back(&hdr->media.param, param); 1861 1862 } -
pjproject/trunk/pjsip/src/test/multipart_test.c
r3244 r3340 117 117 init_media_type(&mt, h_content_type, h_content_subtype, boundary); 118 118 119 if (pjsip_media_type_cmp(&ctype_hdr->media, &mt ) != 0)119 if (pjsip_media_type_cmp(&ctype_hdr->media, &mt, 2) != 0) 120 120 return -20; 121 121 … … 154 154 /* Check content-type: "multipart/mixed;boundary=12345" */ 155 155 init_media_type(&mt, "multipart", "mixed", "12345"); 156 if (pjsip_media_type_cmp(&body->content_type, &mt ) != 0)156 if (pjsip_media_type_cmp(&body->content_type, &mt, 2) != 0) 157 157 return -200; 158 158
Note: See TracChangeset
for help on using the changeset viewer.