Skip to content

Commit

Permalink
lib-smtp: lmtp-client: Fixed bug in timeout handling.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stephanbosch authored and sirainen committed Mar 27, 2017
1 parent 14a37c4 commit a3a4c12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib-smtp/lmtp-client.c
Expand Up @@ -634,7 +634,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);
Expand Down

0 comments on commit a3a4c12

Please sign in to comment.