]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: lmtp-client: Fixed bug in timeout handling.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Wed, 1 Mar 2017 23:42:13 +0000 (00:42 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Fri, 3 Mar 2017 23:26:03 +0000 (00:26 +0100)
The timeout was erroneously stopped when lmtp_client_send() was invoked before a connection was established.
Once the connection finally got established, the timeout was removed.
This would cause the client to wait indefinitely.

src/lib-smtp/lmtp-client.c

index deb8b243242978d52418b1408429735193acf9b3..ed8d542dfc6e7dbcd1d484e4c4b9cd8955edc1ce 100644 (file)
@@ -633,7 +633,7 @@ static void lmtp_client_wait_connect(struct lmtp_client *client)
                                 " (connect)");
                return;
        }
-       if (client->to != NULL)
+       if (client->data_input == NULL && client->to != NULL)
                timeout_remove(&client->to);
        io_remove(&client->io);
        client->io = io_add(client->fd, IO_READ, lmtp_client_input, client);