or we'll disconnect. Use a slightly larger value than for _SEND_USERS_ so
that we'll get a better error if the sender decides to disconnect. */
#define DIRECTOR_CONNECTION_DONE_TIMEOUT_MSECS (40*1000)
-/* How long to wait for PONG for an idling connection */
-#define DIRECTOR_CONNECTION_PING_IDLE_TIMEOUT_MSECS (10*1000)
-/* Maximum time to wait for PONG reply */
-#define DIRECTOR_CONNECTION_PONG_TIMEOUT_MSECS (60*1000)
/* How long to wait to send PING when connection is idle */
#define DIRECTOR_CONNECTION_PING_INTERVAL_MSECS (15*1000)
/* How long to wait before sending PING while waiting for SYNC reply */
to see if there's other work to be done as well. */
#define DIRECTOR_HANDSHAKE_MAX_USERS_SENT_PER_FLUSH 10000
-#if DIRECTOR_CONNECTION_DONE_TIMEOUT_MSECS <= DIRECTOR_CONNECTION_PING_TIMEOUT_MSECS
-# error DIRECTOR_CONNECTION_DONE_TIMEOUT_MSECS is too low
-#endif
-
-#if DIRECTOR_CONNECTION_PONG_TIMEOUT_MSECS <= DIRECTOR_CONNECTION_PING_IDLE_TIMEOUT_MSECS
-# error DIRECTOR_CONNECTION_PONG_TIMEOUT_MSECS is too low
-#endif
-
#define CMD_IS_USER_HANDSHAKE(minor_version, args) \
((minor_version) < DIRECTOR_VERSION_HANDSHAKE_U_CMD && \
str_array_length(args) > 2)
return;
timeout_remove(&conn->to_ping);
- conn->to_ping = timeout_add(DIRECTOR_CONNECTION_PING_IDLE_TIMEOUT_MSECS,
+ conn->to_ping = timeout_add(conn->dir->set->director_ping_idle_timeout*1000,
director_connection_ping_idle_timeout, conn);
- conn->to_pong = timeout_add(DIRECTOR_CONNECTION_PONG_TIMEOUT_MSECS,
+ conn->to_pong = timeout_add(conn->dir->set->director_ping_max_timeout*1000,
director_connection_pong_timeout, conn);
director_connection_send(conn, "PING\n");
conn->ping_waiting = TRUE;
DEF(SET_STR, director_mail_servers),
DEF(SET_STR, director_username_hash),
DEF(SET_STR, director_flush_socket),
+ DEF(SET_TIME, director_ping_idle_timeout),
+ DEF(SET_TIME, director_ping_max_timeout),
DEF(SET_TIME, director_user_expire),
DEF(SET_TIME, director_user_kick_delay),
DEF(SET_IN_PORT, director_doveadm_port),
.director_mail_servers = "",
.director_username_hash = "%Lu",
.director_flush_socket = "",
+ .director_ping_idle_timeout = 30,
+ .director_ping_max_timeout = 60,
.director_user_expire = 60*15,
.director_user_kick_delay = 2,
.director_doveadm_port = 0,
const char *director_username_hash;
const char *director_flush_socket;
+ unsigned int director_ping_idle_timeout;
+ unsigned int director_ping_max_timeout;
unsigned int director_user_expire;
unsigned int director_user_kick_delay;
in_port_t director_doveadm_port;