dovecot-1.1: Added mailbox_name parameter to mailbox_list.iter_i...
dovecot at dovecot.org
dovecot at dovecot.org
Sun May 4 23:47:45 EEST 2008
details: http://hg.dovecot.org/dovecot-1.1/rev/7f7003bcf422
changeset: 7495:7f7003bcf422
user: Timo Sirainen <tss at iki.fi>
date: Sun May 04 23:45:42 2008 +0300
description:
Added mailbox_name parameter to mailbox_list.iter_is_mailbox().
diffstat:
9 files changed, 21 insertions(+), 6 deletions(-)
src/lib-storage/index/cydir/cydir-storage.c | 2 ++
src/lib-storage/index/dbox/dbox-storage.c | 4 +++-
src/lib-storage/index/maildir/maildir-storage.c | 7 +++++--
src/lib-storage/index/mbox/istream-raw-mbox.c | 1 +
src/lib-storage/index/mbox/mbox-storage.c | 2 ++
src/lib-storage/index/raw/raw-storage.c | 2 ++
src/lib-storage/list/mailbox-list-fs-iter.c | 5 +++--
src/lib-storage/list/mailbox-list-maildir-iter.c | 3 ++-
src/lib-storage/mailbox-list-private.h | 1 +
diffs (193 lines):
diff -r 2dd86c2f8efb -r 7f7003bcf422 src/lib-storage/index/cydir/cydir-storage.c
--- a/src/lib-storage/index/cydir/cydir-storage.c Sun May 04 23:44:56 2008 +0300
+++ b/src/lib-storage/index/cydir/cydir-storage.c Sun May 04 23:45:42 2008 +0300
@@ -28,6 +28,7 @@ cydir_list_delete_mailbox(struct mailbox
cydir_list_delete_mailbox(struct mailbox_list *list, const char *name);
static int cydir_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx,
const char *dir, const char *fname,
+ const char *mailbox_name,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags);
@@ -335,6 +336,7 @@ static int cydir_list_iter_is_mailbox(st
static int cydir_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx
ATTR_UNUSED,
const char *dir, const char *fname,
+ const char *mailbox_name ATTR_UNUSED,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags)
{
diff -r 2dd86c2f8efb -r 7f7003bcf422 src/lib-storage/index/dbox/dbox-storage.c
--- a/src/lib-storage/index/dbox/dbox-storage.c Sun May 04 23:44:56 2008 +0300
+++ b/src/lib-storage/index/dbox/dbox-storage.c Sun May 04 23:45:42 2008 +0300
@@ -40,6 +40,7 @@ dbox_list_rename_mailbox_pre(struct mail
const char *oldname, const char *newname);
static int dbox_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx,
const char *dir, const char *fname,
+ const char *mailbox_name,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags);
@@ -306,7 +307,7 @@ static int dbox_storage_mailbox_close(st
static int dbox_storage_mailbox_close(struct mailbox *box)
{
struct dbox_mailbox *mbox = (struct dbox_mailbox *)box;
- int ret;
+ int ret = 0;
if (box->opened) {
/* see if we want to flush dirty flags */
@@ -581,6 +582,7 @@ static int dbox_list_iter_is_mailbox(str
static int dbox_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx
ATTR_UNUSED,
const char *dir, const char *fname,
+ const char *mailbox_name ATTR_UNUSED,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags)
{
diff -r 2dd86c2f8efb -r 7f7003bcf422 src/lib-storage/index/maildir/maildir-storage.c
--- a/src/lib-storage/index/maildir/maildir-storage.c Sun May 04 23:44:56 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-storage.c Sun May 04 23:45:42 2008 +0300
@@ -48,14 +48,15 @@ maildir_list_rename_mailbox(struct mailb
maildir_list_rename_mailbox(struct mailbox_list *list,
const char *oldname, const char *newname);
static int
-maildir_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx
- ATTR_UNUSED,
+maildir_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx,
const char *dir, const char *fname,
+ const char *mailbox_name,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags_r);
static int
maildirplusplus_iter_is_mailbox(struct mailbox_list_iterate_context *ctx,
const char *dir, const char *fname,
+ const char *mailbox_name,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags_r);
@@ -864,6 +865,7 @@ maildir_list_iter_is_mailbox(struct mail
maildir_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx
ATTR_UNUSED,
const char *dir, const char *fname,
+ const char *mailbox_name ATTR_UNUSED,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags_r)
{
@@ -913,6 +915,7 @@ static int
static int
maildirplusplus_iter_is_mailbox(struct mailbox_list_iterate_context *ctx,
const char *dir, const char *fname,
+ const char *mailbox_name ATTR_UNUSED,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags_r)
{
diff -r 2dd86c2f8efb -r 7f7003bcf422 src/lib-storage/index/mbox/istream-raw-mbox.c
--- a/src/lib-storage/index/mbox/istream-raw-mbox.c Sun May 04 23:44:56 2008 +0300
+++ b/src/lib-storage/index/mbox/istream-raw-mbox.c Sun May 04 23:45:42 2008 +0300
@@ -300,6 +300,7 @@ static ssize_t i_stream_raw_mbox_read(st
cached next_offset? */
i_error("Next message unexpectedly lost from %"PRIuUOFF_T,
rstream->hdr_offset + rstream->mail_size);
+ sleep(3600);
rstream->eof = TRUE;
rstream->corrupted = TRUE;
return -1;
diff -r 2dd86c2f8efb -r 7f7003bcf422 src/lib-storage/index/mbox/mbox-storage.c
--- a/src/lib-storage/index/mbox/mbox-storage.c Sun May 04 23:44:56 2008 +0300
+++ b/src/lib-storage/index/mbox/mbox-storage.c Sun May 04 23:45:42 2008 +0300
@@ -71,6 +71,7 @@ static MODULE_CONTEXT_DEFINE_INIT(mbox_m
static int mbox_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx,
const char *dir, const char *fname,
+ const char *mailbox_name,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags);
static int mbox_list_delete_mailbox(struct mailbox_list *list,
@@ -797,6 +798,7 @@ is_inbox_file(struct mailbox_list *list,
static int mbox_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx,
const char *dir, const char *fname,
+ const char *mailbox_name ATTR_UNUSED,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags_r)
{
diff -r 2dd86c2f8efb -r 7f7003bcf422 src/lib-storage/index/raw/raw-storage.c
--- a/src/lib-storage/index/raw/raw-storage.c Sun May 04 23:44:56 2008 +0300
+++ b/src/lib-storage/index/raw/raw-storage.c Sun May 04 23:45:42 2008 +0300
@@ -21,6 +21,7 @@ static int raw_list_delete_mailbox(struc
static int raw_list_delete_mailbox(struct mailbox_list *list, const char *name);
static int raw_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx,
const char *dir, const char *fname,
+ const char *mailbox_name,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags);
@@ -200,6 +201,7 @@ static void raw_notify_changes(struct ma
static int raw_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx,
const char *dir, const char *fname,
+ const char *mailbox_name ATTR_UNUSED,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags_r)
{
diff -r 2dd86c2f8efb -r 7f7003bcf422 src/lib-storage/list/mailbox-list-fs-iter.c
--- a/src/lib-storage/list/mailbox-list-fs-iter.c Sun May 04 23:44:56 2008 +0300
+++ b/src/lib-storage/list/mailbox-list-fs-iter.c Sun May 04 23:45:42 2008 +0300
@@ -349,7 +349,7 @@ static struct mailbox_info *fs_list_inbo
inbox_path = mailbox_list_get_path(ctx->ctx.list, "INBOX",
MAILBOX_LIST_PATH_TYPE_DIR);
path_split(inbox_path, &dir, &fname);
- if (ctx->ctx.list->v.iter_is_mailbox(&ctx->ctx, dir, fname,
+ if (ctx->ctx.list->v.iter_is_mailbox(&ctx->ctx, dir, fname, "INBOX",
MAILBOX_LIST_FILE_TYPE_UNKNOWN,
&ctx->info.flags) < 0)
ctx->ctx.failed = TRUE;
@@ -492,7 +492,7 @@ list_file(struct fs_list_iterate_context
ctx->info.flags = 0;
ret = ctx->ctx.list->v.
iter_is_mailbox(&ctx->ctx, ctx->dir->real_path, fname,
- entry->type, &ctx->info.flags);
+ list_path, entry->type, &ctx->info.flags);
if (ret <= 0)
return ret;
@@ -551,6 +551,7 @@ fs_list_subs(struct fs_list_iterate_cont
MAILBOX_LIST_PATH_TYPE_DIR);
path_split(path, &dir, &fname);
if (ctx->ctx.list->v.iter_is_mailbox(&ctx->ctx, dir, fname,
+ ctx->info.name,
MAILBOX_LIST_FILE_TYPE_UNKNOWN,
&ctx->info.flags) < 0)
ctx->ctx.failed = TRUE;
diff -r 2dd86c2f8efb -r 7f7003bcf422 src/lib-storage/list/mailbox-list-maildir-iter.c
--- a/src/lib-storage/list/mailbox-list-maildir-iter.c Sun May 04 23:44:56 2008 +0300
+++ b/src/lib-storage/list/mailbox-list-maildir-iter.c Sun May 04 23:45:42 2008 +0300
@@ -183,6 +183,7 @@ maildir_fill_readdir(struct maildir_list
T_BEGIN {
ret = ctx->ctx.list->v.
iter_is_mailbox(&ctx->ctx, ctx->dir, fname,
+ mailbox_name,
mailbox_list_get_file_type(d), &flags);
} T_END;
if (ret <= 0) {
@@ -251,7 +252,7 @@ maildir_fill_readdir(struct maildir_list
imap_match(glob, "INBOX") == IMAP_MATCH_YES) {
/* see if INBOX exists. */
ret = ctx->ctx.list->v.
- iter_is_mailbox(&ctx->ctx, ctx->dir, "",
+ iter_is_mailbox(&ctx->ctx, ctx->dir, "", "INBOX",
MAILBOX_LIST_FILE_TYPE_UNKNOWN, &flags);
if (ret > 0) {
node = mailbox_tree_get(ctx->tree_ctx,
diff -r 2dd86c2f8efb -r 7f7003bcf422 src/lib-storage/mailbox-list-private.h
--- a/src/lib-storage/mailbox-list-private.h Sun May 04 23:44:56 2008 +0300
+++ b/src/lib-storage/mailbox-list-private.h Sun May 04 23:45:42 2008 +0300
@@ -41,6 +41,7 @@ struct mailbox_list_vfuncs {
flags may be updated (especially the children flags). */
int (*iter_is_mailbox)(struct mailbox_list_iterate_context *ctx,
const char *dir, const char *fname,
+ const char *mailbox_name,
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags_r);
More information about the dovecot-cvs
mailing list