313 if (cid_str[0] ==
'<') {
317 if (
start != NULL && cid != NULL &&
355 debug(
"mime.parse",0,
"Failed to read MIME headers in Octstr block:");
383 Octstr *entity, *seperator, *os;
408 debug(
"mime.parse",0,
"MIME multipart: Parsing entity:");
429 debug(
"mime.parse",0,
"Failed to see end boundary, parsed line is '%s'.",
503 debug(
"mime.parse",0,
"Failed to read MIME headers in Octstr block:");
688 for (j = 0; j < level * 2; j++)
694 if (m->
start != NULL) {
696 debug(
"mime.dump",0,
"%sRelated to Content-ID <%s> MIMEEntity at address `%p'",
708 for (i = 0; i < items; i++) {
721 debug(
"mms",0,
"Dumping MIMEEntity at address %p", m);
Octstr * parse_get_seperated_block(ParseContext *context, Octstr *seperator)
static Octstr * get_start_param(Octstr *content_type)
void mime_entity_set_body(MIMEEntity *e, Octstr *body)
MIMEEntity * mime_entity_get_part(MIMEEntity *e, int i)
void http_header_add(List *headers, char *name, char *contents)
gw_assert(wtls_machine->packet_to_send !=NULL)
void gwlist_append(List *list, void *item)
void octstr_append(Octstr *ostr1, const Octstr *ostr2)
void mime_entity_replace_part(MIMEEntity *e, int i, MIMEEntity *newpart)
long gwlist_len(List *list)
List * mime_entity_headers(MIMEEntity *m)
void * gwlist_get(List *list, long pos)
Octstr * parse_get_line(ParseContext *context)
void http_header_get_content_type(List *headers, Octstr **type, Octstr **charset)
static void mime_entity_dump_real(MIMEEntity *m, unsigned int level)
void octstr_append_cstr(Octstr *ostr, const char *cstr)
MIMEEntity * mime_entity_create(void)
#define octstr_get_cstr(ostr)
MIMEEntity * mime_multipart_start_elem(MIMEEntity *e)
static void fix_boundary_element(List *headers, Octstr **boundary_elem)
void http_destroy_headers(List *headers)
Octstr * octstr_imm(const char *cstr)
void gwlist_delete(List *list, long pos, long count)
Octstr * mime_entity_to_octstr(MIMEEntity *m)
void octstr_delete(Octstr *ostr1, long pos, long len)
static void mime_entity_destroy_item(void *e)
void mime_entity_destroy(MIMEEntity *e)
List * http_create_empty_headers(void)
static MIMEEntity * mime_something_to_entity(Octstr *mime, List *headers)
static int cid_matches(List *headers, Octstr *start)
#define octstr_duplicate(ostr)
#define octstr_dump(ostr, level,...)
Octstr * mime_entity_body(MIMEEntity *m)
MIMEEntity * mime_http_to_entity(List *headers, Octstr *body)
Octstr * http_get_header_parameter(Octstr *value, Octstr *parameter)
Octstr * octstr_format(const char *fmt,...)
void octstr_destroy(Octstr *ostr)
#define octstr_create(cstr)
void octstr_destroy_item(void *os)
const char * content_type
void mime_replace_headers(MIMEEntity *e, List *headers)
static int read_mime_headers(ParseContext *context, List *headers)
void mime_entity_dump(MIMEEntity *m)
void gwlist_insert(List *list, long pos, void *item)
Octstr * http_header_value(List *headers, Octstr *name)
long octstr_len(const Octstr *ostr)
void parse_context_destroy(ParseContext *context)
struct MIMEEntity * start
void debug(const char *place, int err, const char *fmt,...)
long http_header_remove_all(List *headers, char *name)
int octstr_str_ncompare(const Octstr *ostr, const char *str, long n)
void octstr_format_append(Octstr *os, const char *fmt,...)
List * http_header_duplicate(List *headers)
void mime_entity_add_part(MIMEEntity *e, MIMEEntity *part)
MIMEEntity * mime_octstr_to_entity(Octstr *mime)
void mime_entity_remove_part(MIMEEntity *e, int i)
Octstr * parse_get_rest(ParseContext *context)
int octstr_get_char(const Octstr *ostr, long pos)
MIMEEntity * mime_entity_duplicate(MIMEEntity *e)
ParseContext * parse_context_create(Octstr *str)
int mime_entity_num_parts(MIMEEntity *e)
int octstr_compare(const Octstr *ostr1, const Octstr *ostr2)
void gwlist_destroy(List *list, gwlist_item_destructor_t *destructor)