changeset 21499:b3aa71d6fd25

pop3c: Increase timeout for PASS to 5 minutes.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Wed, 08 Feb 2017 23:01:32 +0200
parents e74e1269959f
children 0e1b477141bc
files src/lib-storage/index/pop3c/pop3c-client.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/pop3c/pop3c-client.c	Mon Feb 06 14:05:47 2017 +0200
+++ b/src/lib-storage/index/pop3c/pop3c-client.c	Wed Feb 08 23:01:32 2017 +0200
@@ -438,6 +438,13 @@
 				client->set.host, line);
 			return -1;
 		}
+
+		/* the PASS reply can take a long time.
+		   switch to command timeout. */
+		timeout_remove(&client->to);
+		client->to = timeout_add(POP3C_COMMAND_TIMEOUT_MSECS,
+					 pop3c_client_timeout, client);
+
 		o_stream_nsend_str(client->output,
 			t_strdup_printf("PASS %s\r\n", client->set.password));
 		client->state = POP3C_CLIENT_STATE_PASS;