From: Timo Sirainen Date: Thu, 27 Oct 2022 19:45:24 +0000 (+0300) Subject: replicator: Log dsync error code in debug message X-Git-Tag: 2.4.0~3474 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a8b5412ccb536b21cb61b9187c96ba3c2b170a5;p=thirdparty%2Fdovecot%2Fcore.git replicator: Log dsync error code in debug message --- diff --git a/src/replication/replicator/dsync-client.c b/src/replication/replicator/dsync-client.c index a0208e49c0..939dc000ce 100644 --- a/src/replication/replicator/dsync-client.c +++ b/src/replication/replicator/dsync-client.c @@ -139,7 +139,7 @@ static int dsync_input_line(struct dsync_client *client, const char *line) else if (strcmp(line+1, "NOREPLICATE") == 0) dsync_callback(client, "", DSYNC_REPLY_NOREPLICATE); else - dsync_callback(client, "", DSYNC_REPLY_FAIL); + dsync_callback(client, line+1, DSYNC_REPLY_FAIL); } else { e_error(client->event, "Invalid input: %s", line); return -1; diff --git a/src/replication/replicator/replicator-brain.c b/src/replication/replicator/replicator-brain.c index 88fe2de5a2..8e40b8887b 100644 --- a/src/replication/replicator/replicator-brain.c +++ b/src/replication/replicator/replicator-brain.c @@ -142,13 +142,13 @@ static void dsync_callback(enum dsync_reply reply, const char *state, replicator_queue_remove(ctx->brain->queue, &ctx->user); } else { i_free(ctx->user->state); - ctx->user->state = i_strdup_empty(state); ctx->user->last_sync_failed = reply != DSYNC_REPLY_OK; if (reply == DSYNC_REPLY_OK) { e_debug(ctx->event, "User was successfully synced"); + ctx->user->state = i_strdup_empty(state); ctx->user->last_successful_sync = ioloop_time; } else { - e_debug(ctx->event, "User sync failed"); + e_debug(ctx->event, "User sync failed: %s", state); } replicator_queue_push(ctx->brain->queue, ctx->user); }