Changeset 5569
- Timestamp:
- Mar 21, 2017 7:19:43 AM (8 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/sip_multipart.h
r3553 r5569 171 171 172 172 /** 173 * Get the boundary string and the raw message body of the specified 174 * multipart message body. Note that raw message body will only be available 175 * if the multipart message body is generated by pjsip_multipart_parse(). 176 * 177 * @param mp The multipart message body. 178 * @param boundary Optional parameter to receive the boundary string. 179 * @param raw_data Optional parameter to receive the raw message body. 180 * 181 * @return PJ_SUCCESS on success. 182 */ 183 PJ_DECL(pj_status_t) pjsip_multipart_get_raw(pjsip_msg_body *mp, 184 pj_str_t *boundary, 185 pj_str_t *raw_data); 186 187 /** 173 188 * @} PJSIP_MULTIPART 174 189 */ -
pjproject/trunk/pjsip/src/pjsip/sip_multipart.c
r5545 r5569 46 46 pj_str_t boundary; 47 47 pjsip_multipart_part part_head; 48 pj_str_t raw_data; 48 49 }; 49 50 … … 609 610 body = pjsip_multipart_create(pool, ctype, &boundary); 610 611 612 /* Save full raw body */ 613 { 614 struct multipart_data *mp = (struct multipart_data*)body->data; 615 pj_strset(&mp->raw_data, buf, len); 616 } 617 611 618 for (;;) { 612 619 char *start_body, *end_body; … … 668 675 } 669 676 677 678 PJ_DEF(pj_status_t) pjsip_multipart_get_raw( pjsip_msg_body *mp, 679 pj_str_t *boundary, 680 pj_str_t *raw_data) 681 { 682 struct multipart_data *m_data; 683 684 /* Must specify mandatory params */ 685 PJ_ASSERT_RETURN(mp, PJ_EINVAL); 686 687 /* mp must really point to an actual multipart msg body */ 688 PJ_ASSERT_RETURN(mp->print_body==&multipart_print_body, PJ_EINVAL); 689 690 m_data = (struct multipart_data*)mp->data; 691 692 if (boundary) 693 *boundary = m_data->boundary; 694 695 if (raw_data) 696 *raw_data = m_data->raw_data; 697 698 return PJ_SUCCESS; 699 }
Note: See TracChangeset
for help on using the changeset viewer.