Changeset 5545
- Timestamp:
- Jan 24, 2017 5:59:05 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_multipart.c
r5170 r5545 68 68 char *clen_pos; 69 69 const pjsip_hdr *hdr; 70 pj_bool_t ctype_printed = PJ_FALSE; 70 71 71 72 clen_pos = NULL; … … 83 84 while (hdr != &part->hdr) { 84 85 int printed = pjsip_hdr_print_on((pjsip_hdr*)hdr, p, 85 86 SIZE_LEFT()-2); 86 87 if (printed < 0) 87 88 return -1; … … 89 90 *p++ = '\r'; 90 91 *p++ = '\n'; 92 93 if (!ctype_printed && hdr->type == PJSIP_H_CONTENT_TYPE) 94 ctype_printed = PJ_TRUE; 95 91 96 hdr = hdr->next; 92 97 } 93 98 94 99 /* Automaticly adds Content-Type and Content-Length headers, only 95 * if content_type is set in the message body .100 * if content_type is set in the message body and haven't been printed. 96 101 */ 97 if (part->body && part->body->content_type.type.slen) { 102 if (part->body && part->body->content_type.type.slen && !ctype_printed) 103 { 98 104 pj_str_t ctype_hdr = { "Content-Type: ", 14}; 99 105 const pjsip_media_type *media = &part->body->content_type;
Note: See TracChangeset
for help on using the changeset viewer.