Mercurial > dovecot > core-2.2
changeset 17:b4e760cf04c3 HEAD
bugfix
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 23 Aug 2002 01:19:17 +0300 |
parents | 3de6ef1b50cb |
children | 6491ac40cdf5 |
files | src/lib-mail/message-send.c |
diffstat | 1 files changed, 3 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-mail/message-send.c Fri Aug 23 01:12:10 2002 +0300 +++ b/src/lib-mail/message-send.c Fri Aug 23 01:19:17 2002 +0300 @@ -10,7 +10,7 @@ int message_send(IOBuffer *outbuf, IOBuffer *inbuf, MessageSize *msg_size, off_t virtual_skip, off_t max_virtual_size) { - unsigned char *msg, *buf; + unsigned char *msg, buf[OUTPUT_BUFFER_SIZE]; unsigned int i, size, pos; int cr_skipped, add_cr; @@ -31,9 +31,6 @@ message_skip_virtual(inbuf, virtual_skip, NULL, &cr_skipped); /* go through the message data and insert CRs where needed. */ - buf = io_buffer_get_space(outbuf, OUTPUT_BUFFER_SIZE); - i_assert(buf != NULL); - pos = 0; while (io_buffer_read_data(inbuf, &msg, &size, 0) >= 0) { add_cr = FALSE; @@ -60,7 +57,7 @@ if (pos + i >= OUTPUT_BUFFER_SIZE) { /* buffer is full, flush it */ - if (io_buffer_send_buffer(outbuf, pos) <= 0) + if (io_buffer_send(outbuf, buf, pos) <= 0) return FALSE; pos = 0; } @@ -90,7 +87,7 @@ io_buffer_skip(inbuf, i); } - if (io_buffer_send_buffer(outbuf, pos) <= 0) + if (io_buffer_send(outbuf, buf, pos) <= 0) return FALSE; return TRUE;