comparison src/director/director-connection.c @ 14575:dbe6d05fd595

director: When we find unwanted connection, wait for 10s for it to disconnect us, not 10ms.
author Timo Sirainen <tss@iki.fi>
date Sun, 20 May 2012 03:08:01 +0300
parents 42cca8a1d179
children c93ca5e46a8a 7be9411da17b
comparison
equal deleted inserted replaced
14574:1c2c1d75d3b2 14575:dbe6d05fd595
68 /* How long to wait before sending PING while waiting for SYNC reply */ 68 /* How long to wait before sending PING while waiting for SYNC reply */
69 #define DIRECTOR_CONNECTION_PING_SYNC_INTERVAL_MSECS 1000 69 #define DIRECTOR_CONNECTION_PING_SYNC_INTERVAL_MSECS 1000
70 /* If outgoing director connection exists for less than this many seconds, 70 /* If outgoing director connection exists for less than this many seconds,
71 mark the host as failed so we won't try to reconnect to it immediately */ 71 mark the host as failed so we won't try to reconnect to it immediately */
72 #define DIRECTOR_SUCCESS_MIN_CONNECT_SECS 40 72 #define DIRECTOR_SUCCESS_MIN_CONNECT_SECS 40
73 #define DIRECTOR_WAIT_DISCONNECT_MSECS 10 73 #define DIRECTOR_WAIT_DISCONNECT_SECS 10
74 74
75 #if DIRECTOR_CONNECTION_DONE_TIMEOUT_MSECS <= DIRECTOR_CONNECTION_PING_TIMEOUT_MSECS 75 #if DIRECTOR_CONNECTION_DONE_TIMEOUT_MSECS <= DIRECTOR_CONNECTION_PING_TIMEOUT_MSECS
76 # error DIRECTOR_CONNECTION_DONE_TIMEOUT_MSECS is too low 76 # error DIRECTOR_CONNECTION_DONE_TIMEOUT_MSECS is too low
77 #endif 77 #endif
78 78
185 director_connection_send(conn, connect_str); 185 director_connection_send(conn, connect_str);
186 (void)o_stream_flush(conn->output); 186 (void)o_stream_flush(conn->output);
187 o_stream_uncork(conn->output); 187 o_stream_uncork(conn->output);
188 188
189 conn->to_disconnect = 189 conn->to_disconnect =
190 timeout_add(DIRECTOR_WAIT_DISCONNECT_MSECS, 190 timeout_add(DIRECTOR_WAIT_DISCONNECT_SECS*1000,
191 director_connection_wait_timeout, conn); 191 director_connection_wait_timeout, conn);
192 } 192 }
193 193
194 static void director_connection_assigned(struct director_connection *conn) 194 static void director_connection_assigned(struct director_connection *conn)
195 { 195 {