]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
submission: Add backend flag indicating whether the backend is ready.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Fri, 26 Oct 2018 15:00:32 +0000 (17:00 +0200)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Mon, 29 Oct 2018 16:40:18 +0000 (17:40 +0100)
This flag is set just before the ready() vfunc is called.

src/submission/submission-backend.c
src/submission/submission-backend.h

index 1fa12c69c2b9aec2d89470bb03ddbb02a8843291..07b6caa41facc459e526a5a6e5f08bdd8537ff41 100644 (file)
@@ -61,6 +61,7 @@ void submission_backend_started(struct submission_backend *backend,
 
        if (backend == client->backend_default)
                client_default_backend_started(client, caps);
+       backend->ready = TRUE;
        if (backend->v.ready != NULL)
                backend->v.ready(backend, caps);
 }
@@ -161,6 +162,7 @@ void submission_backend_fail(struct submission_backend *backend,
        if (!failed_before && backend->v.fail != NULL)
                backend->v.fail(backend, enh_code, reason);
        backend->started = FALSE;
+       backend->ready = FALSE;
 }
 
 void submission_backends_client_input_pre(struct client *client)
index 268c62d22e92d4c39437d0ff93fbac170d94c418..249fa6385ca3f21600a345afd9e00f57519a286c 100644 (file)
@@ -91,6 +91,7 @@ struct submission_backend {
        char *fail_reason;
 
        bool started:1;
+       bool ready:1;
        bool trans_started:1;
 };