[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-mail.c, 1.15,
1.16
cras at dovecot.org
cras at dovecot.org
Sat Aug 28 13:32:19 EEST 2004
- Previous message: [dovecot-cvs] dovecot/src/lib-storage/index index-mail.c, 1.50,
1.51 index-mail.h, 1.21, 1.22 index-search.c, 1.92, 1.93
- Next message: [dovecot-cvs]
dovecot/src/pop3 client.c, 1.31, 1.32 commands.c, 1.22, 1.23
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv21625/lib-storage/index/mbox
Modified Files:
mbox-mail.c
Log Message:
Added mail.get_physical_size().
Index: mbox-mail.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-mail.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- mbox-mail.c 22 Aug 2004 10:32:55 -0000 1.15
+++ mbox-mail.c 28 Aug 2004 10:32:17 -0000 1.16
@@ -111,6 +111,24 @@
return index_mail_get_special(_mail, field);
}
+static uoff_t mbox_mail_get_physical_size(struct mail *_mail)
+{
+ struct index_mail *mail = (struct index_mail *)_mail;
+ struct index_mail_data *data = &mail->data;
+ struct istream *stream;
+ uoff_t hdr_offset, body_offset, body_size;
+
+ /* our header size varies, so don't do any caching */
+ stream = mail->ibox->mbox_stream;
+ hdr_offset = istream_raw_mbox_get_header_offset(stream);
+ body_offset = istream_raw_mbox_get_body_offset(stream);
+ body_size = istream_raw_mbox_get_body_size(stream, (uoff_t)-1);
+
+ data->physical_size = (body_offset - hdr_offset) + body_size;
+ return data->physical_size;
+
+}
+
static struct istream *mbox_mail_get_stream(struct mail *_mail,
struct message_size *hdr_size,
struct message_size *body_size)
@@ -147,7 +165,8 @@
index_mail_get_parts,
mbox_mail_get_received_date,
index_mail_get_date,
- index_mail_get_size,
+ index_mail_get_virtual_size,
+ mbox_mail_get_physical_size,
index_mail_get_header,
index_mail_get_headers,
mbox_mail_get_stream,
- Previous message: [dovecot-cvs] dovecot/src/lib-storage/index index-mail.c, 1.50,
1.51 index-mail.h, 1.21, 1.22 index-search.c, 1.92, 1.93
- Next message: [dovecot-cvs]
dovecot/src/pop3 client.c, 1.31, 1.32 commands.c, 1.22, 1.23
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list