bool notified:1;
bool failed:1;
+ bool started:1;
bool completed:1;
};
{
int ret;
+ ctx->started = TRUE;
if ((ret = fts_indexer_more_int(ctx)) < 0) {
/* If failed is already set, the code has had a chance to
* set an internal error already, i.e. MAIL_ERROR_INUSE. */
struct fts_indexer_context *ctx =
container_of(conn, struct fts_indexer_context, conn);
connection_deinit(conn);
- if (!ctx->completed)
+ if (ctx->started && !ctx->completed)
ctx->failed = TRUE;
ctx->completed = TRUE;
}
struct fts_indexer_context *ctx = *_ctx;
i_assert(ctx != NULL);
*_ctx = NULL;
- if (!ctx->completed)
+ if (ctx->started && !ctx->completed)
ctx->failed = TRUE;
int ret = ctx->failed ? -1 : 0;
if (ctx->notified) {
ctx->failed = TRUE;
return;
}
- ctx->failed = ctx->completed = FALSE;
+ ctx->failed = ctx->started = ctx->completed = FALSE;
const char *cmd = t_strdup_printf("PREPEND\t1\t%s\t%s\t0\t%s\n",
str_tabescape(ctx->box->storage->user->username),
str_tabescape(ctx->box->vname),