]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Remove root_sep_lookup_failed cache
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 12 Jun 2017 08:57:52 +0000 (11:57 +0300)
committerGitLab <gitlab@git.dovecot.net>
Mon, 12 Jun 2017 13:23:59 +0000 (16:23 +0300)
The auth_failed_* should already be enough for this. This removal also
fixes the storage error message to be auth_failed_reason when possible.

src/lib-storage/index/imapc/imapc-list.c
src/lib-storage/index/imapc/imapc-list.h

index 2d3318fb4426a4e2c6f6c01b36f31ebda09ec4b0..02599973028bf9f766cc0260c6f9a5b11b75d1a1 100644 (file)
@@ -329,12 +329,9 @@ static char imapc_list_get_hierarchy_sep(struct mailbox_list *_list)
        struct imapc_mailbox_list *list = (struct imapc_mailbox_list *)_list;
        char sep;
 
-       if (list->root_sep_lookup_failed ||
-           imapc_list_try_get_root_sep(list, &sep) < 0) {
+       if (imapc_list_try_get_root_sep(list, &sep) < 0) {
                /* we can't really return a failure here. just return a common
                   separator and fail all the future list operations. */
-               list->root_sep_lookup_failed = TRUE;
-               mailbox_list_set_internal_error(_list);
                return '/';
        }
        return sep;
@@ -551,13 +548,10 @@ static int imapc_list_refresh(struct imapc_mailbox_list *list)
        struct imapc_simple_context ctx;
        struct mailbox_node *node;
        const char *pattern;
+       char sep;
 
-       if (imapc_storage_client_handle_auth_failure(list->client))
-               return -1;
-       if (list->root_sep_lookup_failed) {
-               mailbox_list_set_internal_error(&list->list);
+       if (imapc_list_try_get_root_sep(list, &sep) < 0)
                return -1;
-       }
        if (list->refreshed_mailboxes)
                return 0;
 
@@ -783,14 +777,12 @@ imapc_list_subscriptions_refresh(struct mailbox_list *_src_list,
        struct imapc_simple_context ctx;
        struct imapc_command *cmd;
        const char *pattern;
-       char dest_sep = mail_namespace_get_sep(dest_list->ns);
+       char list_sep, dest_sep = mail_namespace_get_sep(dest_list->ns);
 
        i_assert(src_list->tmp_subscriptions == NULL);
 
-       if (src_list->root_sep_lookup_failed) {
-               mailbox_list_set_internal_error(_src_list);
+       if (imapc_list_try_get_root_sep(src_list, &list_sep) < 0)
                return -1;
-       }
 
        if (src_list->refreshed_subscriptions) {
                if (dest_list->subscriptions == NULL)
index 84bdbe112ca3a8a9c06659df70dbc397e1d4fcc1..b86060c25fcb3d1561ab3c68dcce956ed39e75ae 100644 (file)
@@ -30,7 +30,6 @@ struct imapc_mailbox_list {
        bool refreshed_mailboxes_recently:1;
        bool index_list_failed:1;
        bool root_sep_pending:1;
-       bool root_sep_lookup_failed:1;
 };
 
 int imapc_list_get_mailbox_flags(struct mailbox_list *list, const char *name,