[dovecot-cvs] dovecot/src/lib-mail message-parser.c,1.80,1.81
tss at dovecot.org
tss at dovecot.org
Thu Mar 8 15:22:55 EET 2007
Update of /var/lib/cvs/dovecot/src/lib-mail
In directory talvi:/tmp/cvs-serv19448
Modified Files:
message-parser.c
Log Message:
And more fixes
Index: message-parser.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/message-parser.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- message-parser.c 6 Feb 2007 13:42:54 -0000 1.80
+++ message-parser.c 8 Mar 2007 13:22:53 -0000 1.81
@@ -75,8 +75,6 @@
const unsigned char *data = block->data;
size_t i;
- i_assert(ctx->skip == 0);
-
block->hdr = NULL;
for (i = 0; i < block->size; i++) {
@@ -95,7 +93,7 @@
ctx->part->body_size.virtual_size += block->size + missing_cr_count;
ctx->last_chr = data[i-1];
- ctx->skip = block->size;
+ ctx->skip += block->size;
}
static int message_parser_read_more(struct message_parser_ctx *ctx,
@@ -356,13 +354,10 @@
/* leave CR+LF + last line to buffer */
block_r->size = boundary_start;
}
- if (ret <= 0) {
- if (block_r->size != 0)
- parse_body_add_block(ctx, block_r);
- return ret;
- }
-
- return parse_part_finish(ctx, boundary, block_r);
+ if (block_r->size != 0)
+ parse_body_add_block(ctx, block_r);
+ return ret <= 0 ? ret :
+ parse_part_finish(ctx, boundary, block_r);
}
static int parse_next_body_to_eof(struct message_parser_ctx *ctx,
@@ -498,6 +493,7 @@
i_assert((part->flags & MUTEX_FLAGS) != MUTEX_FLAGS);
+ ctx->last_chr = '\n';
if (ctx->last_boundary != NULL) {
parse_next_body_multipart_init(ctx);
ctx->parse_next_block = parse_next_body_to_boundary;
More information about the dovecot-cvs
mailing list