dovecot-2.2: dbox: Use lib-fs API also for reading the attachments.

dovecot at dovecot.org dovecot at dovecot.org
Wed Nov 6 23:01:14 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/883ba4a47829
changeset: 16945:883ba4a47829
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Nov 06 21:10:22 2013 +0200
description:
dbox: Use lib-fs API also for reading the attachments.

diffstat:

 src/lib-storage/index/dbox-common/dbox-attachment.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (31 lines):

diff -r 9d5bfd8e50c9 -r 883ba4a47829 src/lib-storage/index/dbox-common/dbox-attachment.c
--- a/src/lib-storage/index/dbox-common/dbox-attachment.c	Wed Nov 06 21:08:42 2013 +0200
+++ b/src/lib-storage/index/dbox-common/dbox-attachment.c	Wed Nov 06 21:10:22 2013 +0200
@@ -3,6 +3,8 @@
 #include "lib.h"
 #include "istream.h"
 #include "str.h"
+#include "fs-api.h"
+#include "istream-fs-file.h"
 #include "istream-attachment-connector.h"
 #include "dbox-file.h"
 #include "dbox-save.h"
@@ -143,6 +145,7 @@
 	ARRAY_TYPE(mail_attachment_extref) extrefs_arr;
 	const struct mail_attachment_extref *extref;
 	struct istream_attachment_connector *conn;
+	struct fs_file *fsfile;
 	struct istream *input;
 	const char *path, *path_suffix;
 	uoff_t msg_size;
@@ -170,7 +173,9 @@
 	array_foreach(&extrefs_arr, extref) {
 		path = t_strdup_printf("%s/%s%s", file->storage->attachment_dir,
 				       extref->path, path_suffix);
-		input = i_stream_create_file(path, IO_BLOCK_SIZE);
+		fsfile = fs_file_init(file->storage->attachment_fs, path,
+				      FS_OPEN_MODE_READONLY);
+		input = i_stream_create_fs_file(&fsfile, IO_BLOCK_SIZE);
 
 		ret = istream_attachment_connector_add(conn, input,
 					extref->start_offset, extref->size,


More information about the dovecot-cvs mailing list