]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: test-smtp-payload - Finish client transaction only when it finishes completely.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Thu, 22 Apr 2021 10:09:11 +0000 (12:09 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 21 May 2021 20:20:48 +0000 (20:20 +0000)
src/lib-smtp/test-smtp-payload.c

index 513a82cfcd574f706f51cfa53c802e3757c58f12..e8e93f4b2a7a6461fb8e2448f82314828d273875 100644 (file)
@@ -576,6 +576,8 @@ static void
 test_client_transaction_finish(struct test_client_transaction *tctrans)
 {
        tctrans->conn->trans = NULL;
+       if (io_loop_is_running(current_ioloop))
+               test_client_finished(tctrans->files_idx);
        test_client_transaction_destroy(tctrans);
 }
 
@@ -661,8 +663,6 @@ test_client_transaction_data(const struct smtp_reply *reply,
                        "SMTP transaction for %s failed: %s",
                        path, smtp_reply_log(reply));
        }
-
-       test_client_finished(tctrans->files_idx);
 }
 
 static void test_client_continue(void *dummy ATTR_UNUSED)