diff src/director/director-connection.c @ 14477:ea5b949a623b

director: Increased timeout for sending USER data in handshake.
author Timo Sirainen <tss@iki.fi>
date Fri, 20 Apr 2012 00:13:55 +0300
parents 8245a97bf36c
children ee169584bc44
line wrap: on
line diff
--- a/src/director/director-connection.c	Fri Apr 20 00:03:47 2012 +0300
+++ b/src/director/director-connection.c	Fri Apr 20 00:13:55 2012 +0300
@@ -52,6 +52,10 @@
 /* Max idling time before "ME" command must have been received,
    or we'll disconnect. */
 #define DIRECTOR_CONNECTION_ME_TIMEOUT_MSECS (10*1000)
+/* Max time to wait for USERs in handshake to be sent. With a lot of users the
+   kernel may quickly eat up everything we send, while the receiver is busy
+   parsing the data. */
+#define DIRECTOR_CONNECTION_SEND_USERS_TIMEOUT_MSECS (120*1000)
 /* Max idling time before "DONE" command must have been received,
    or we'll disconnect. */
 #define DIRECTOR_CONNECTION_DONE_TIMEOUT_MSECS (30*1000)
@@ -1368,6 +1372,9 @@
 				    director_connection_output, conn);
 
 	io_remove(&conn->io);
+	timeout_remove(&conn->to_ping);
+	conn->to_ping = timeout_add(DIRECTOR_CONNECTION_SEND_USERS_TIMEOUT_MSECS,
+				    director_connection_init_timeout, conn);
 
 	o_stream_cork(conn->output);
 	director_connection_send_handshake(conn);