message-parser.c revision 3ad3dedbbd92137f410330acc9c5682571778a4e
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen/* Copyright (c) 2002-2009 Dovecot authors, see the included COPYING file */
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen/* RFC-2046 requires boundaries are max. 70 chars + "--" prefix + "--" suffix.
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen We'll add a bit more just in case. */
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen struct message_header_parser_ctx *hdr_parser_ctx;
c0435c854a0e7246373b9752d163095cc4fbe985Timo Sirainen int (*parse_next_block)(struct message_parser_ctx *ctx,
c0435c854a0e7246373b9752d163095cc4fbe985Timo Sirainenmessage_part_header_callback_t *null_message_part_header_callback = NULL;
2767104d81e97a109f0aa9758792bfa1da325a97Timo Sirainenstatic int parse_next_header_init(struct message_parser_ctx *ctx,
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainenstatic int parse_next_body_to_boundary(struct message_parser_ctx *ctx,
03f5c621d06d6b6d77a145196c9633a7aa64dc78Timo Sirainenstatic int parse_next_body_to_eof(struct message_parser_ctx *ctx,
03f5c621d06d6b6d77a145196c9633a7aa64dc78Timo Sirainenstatic int preparsed_parse_next_header_init(struct message_parser_ctx *ctx,
c0435c854a0e7246373b9752d163095cc4fbe985Timo Sirainenboundary_find(struct message_boundary *boundaries,
return boundaries;
return NULL;
unsigned int missing_cr_count = 0;
size_t i;
int ret;
if (ret <= 0) {
switch (ret) {
i_unreached();
static struct message_part *
return part;
struct message_boundary *b;
size_t i;
size_t i;
int ret;
bool full;
return ret;
const unsigned char *data;
int ret;
bool full;
return ret;
if (ret >= 0) {
return ret == 0 ? 0 :
boundary_start = i;
if (boundary_start != 0) {
&boundary);
if (ret >= 0) {
ret = 0;
bool full;
int ret;
return ret;
const char *const *results;
#define MUTEX_FLAGS \
int ret;
return ret;
else T_BEGIN {
} T_END;
MESSAGE_PART_FLAG_MULTIPART_DIGEST) != 0) {
bool full;
int ret;
return ret;
int ret;
return ret;
struct message_parser_ctx *
return ctx;
struct message_parser_ctx *
return ctx;
return ret;
int ret;
if (ret == 0) {
return ret;
void *context)
int ret;
if (ret < 0) {
void *context)
int ret;