Mercurial > dovecot > original-hg > dovecot-1.2
changeset 3846:223ceff28fc3 HEAD
Use CR+LF linefeeds always so that physical size = virtual size.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 11 Jan 2006 21:36:50 +0200 |
parents | 18a786df5815 |
children | 145b9742b741 |
files | src/lib-storage/index/dbox/dbox-mail.c src/lib-storage/index/dbox/dbox-uidlist.c |
diffstat | 2 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/dbox/dbox-mail.c Wed Jan 11 21:26:05 2006 +0200 +++ b/src/lib-storage/index/dbox/dbox-mail.c Wed Jan 11 21:36:50 2006 +0200 @@ -38,7 +38,7 @@ return 0; } - mail->data.physical_size = + mail->data.physical_size = mail->data.virtual_size = hex2dec(hdr->mail_size_hex, sizeof(hdr->mail_size_hex)); mail->data.received_date = hex2dec(hdr->received_time_hex, sizeof(hdr->received_time_hex)); @@ -201,7 +201,7 @@ index_mail_get_parts, dbox_mail_get_received_date, index_mail_get_date, - index_mail_get_virtual_size, + dbox_mail_get_physical_size, /* physical = virtual in our case */ dbox_mail_get_physical_size, index_mail_get_first_header, index_mail_get_headers,
--- a/src/lib-storage/index/dbox/dbox-uidlist.c Wed Jan 11 21:26:05 2006 +0200 +++ b/src/lib-storage/index/dbox/dbox-uidlist.c Wed Jan 11 21:36:50 2006 +0200 @@ -860,6 +860,7 @@ struct dbox_uidlist_entry *const *entries; struct dbox_file *file; struct dotlock *dotlock; + struct ostream *output; string_t *str; unsigned int i, count; struct stat st; @@ -949,7 +950,12 @@ file->input = i_stream_create_file(file->fd, default_pool, 65536, FALSE); - file->output = o_stream_create_file(file->fd, default_pool, 0, FALSE); + + /* we'll be using CRLF linefeeds always */ + output = o_stream_create_file(file->fd, default_pool, 0, FALSE); + file->output = o_stream_create_crlf(default_pool, output); + o_stream_unref(output); + if (st.st_size < sizeof(struct dbox_file_header)) { if (dbox_file_write_header(mbox, file) < 0) { dbox_file_close(file);