]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Error logging cleanups.
authorTimo Sirainen <tss@iki.fi>
Sun, 4 Sep 2011 09:04:09 +0000 (12:04 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 4 Sep 2011 09:04:09 +0000 (12:04 +0300)
Don't bother to log disconnection errors for NOOP.

src/lib-storage/index/imapc/imapc-mail-fetch.c
src/lib-storage/index/imapc/imapc-storage.c
src/lib-storage/index/imapc/imapc-storage.h
src/lib-storage/index/imapc/imapc-sync.c

index 587d6ad8f82be8e91c0ade23d05f4593e4c8520a..b9d726d91ae1388dabb114dd064d622818346803 100644 (file)
@@ -41,7 +41,7 @@ imapc_mail_prefetch_callback(const struct imapc_command_reply *reply,
                                            reply);
        } else {
                mail_storage_set_critical(&mbox->storage->storage,
-                       "imapc: Command failed: %s", reply->text_full);
+                       "imapc: Mail prefetch failed: %s", reply->text_full);
        }
        imapc_client_stop(mbox->storage->client);
 }
index b842b37695bfe10515cbfd9dead95f36eac8ffee..9290ca7f9dfca4c68dacd41114144b45f0067323 100644 (file)
@@ -126,8 +126,8 @@ void imapc_simple_callback(const struct imapc_command_reply *reply,
        imapc_client_stop(ctx->storage->client);
 }
 
-static void imapc_async_callback(const struct imapc_command_reply *reply,
-                                void *context)
+static void imapc_noop_callback(const struct imapc_command_reply *reply,
+                               void *context)
 
 {
        struct imapc_storage *storage = context;
@@ -136,18 +136,18 @@ static void imapc_async_callback(const struct imapc_command_reply *reply,
                ;
        else if (reply->state == IMAPC_COMMAND_STATE_NO) {
                imapc_copy_error_from_reply(storage, MAIL_ERROR_PARAMS, reply);
-       } else {
+       } else if (reply->state != IMAPC_COMMAND_STATE_DISCONNECTED) {
                mail_storage_set_critical(&storage->storage,
-                       "imapc: Command failed: %s", reply->text_full);
+                       "imapc: NOOP failed: %s", reply->text_full);
        }
 }
 
-void imapc_async_stop_callback(const struct imapc_command_reply *reply,
+void imapc_noop_stop_callback(const struct imapc_command_reply *reply,
                               void *context)
 {
        struct imapc_storage *storage = context;
 
-       imapc_async_callback(reply, context);
+       imapc_noop_callback(reply, context);
        imapc_client_stop(storage->client);
 }
 
@@ -507,7 +507,7 @@ static int imapc_mailbox_get_metadata(struct mailbox *box,
 static void imapc_idle_timeout(struct imapc_mailbox *mbox)
 {
        imapc_client_mailbox_cmd(mbox->client_box, "NOOP",
-                                imapc_async_callback, mbox->storage);
+                                imapc_noop_callback, mbox->storage);
 }
 
 static void imapc_idle_noop_callback(const struct imapc_command_reply *reply,
@@ -516,7 +516,7 @@ static void imapc_idle_noop_callback(const struct imapc_command_reply *reply,
 {
        struct imapc_mailbox *mbox = context;
 
-       imapc_async_callback(reply, mbox->box.storage);
+       imapc_noop_callback(reply, mbox->box.storage);
        imapc_client_mailbox_idle(mbox->client_box);
 }
 
index c697efbbabbe781e40e37775f0a96338a3e4c518..63057936bde18e610f66adf45c33dcd967ec6d70 100644 (file)
@@ -87,8 +87,8 @@ void imapc_simple_context_init(struct imapc_simple_context *sctx,
 void imapc_simple_run(struct imapc_simple_context *sctx);
 void imapc_simple_callback(const struct imapc_command_reply *reply,
                           void *context);
-void imapc_async_stop_callback(const struct imapc_command_reply *reply,
-                              void *context);
+void imapc_noop_stop_callback(const struct imapc_command_reply *reply,
+                             void *context);
 int imapc_mailbox_commit_delayed_trans(struct imapc_mailbox *mbox,
                                       bool *changes_r);
 
index 84d3415a63b1b524ea73aae054c1ef6afee5f738..180c4a8a01916e4af6dc42e8cd085ef8a53ddb59 100644 (file)
@@ -314,7 +314,7 @@ imapc_mailbox_sync_init(struct mailbox *box, enum mailbox_sync_flags flags)
                /* IDLE not supported. do NOOP to get latest changes
                   before starting sync. */
                imapc_client_mailbox_cmdf(mbox->client_box,
-                                         imapc_async_stop_callback,
+                                         imapc_noop_stop_callback,
                                          mbox->storage, "NOOP");
                imapc_client_run(mbox->storage->client);
        }