Prevent indefinite wait if CONNECT_DELAY is set to zero

set_server_bits() now returns -1 for "no timeout", so 0 is a legitimate
return value.

io() should only update real_timeout from server_timeout if server_timeout
is not -1 (real_timeout == -1 ends up meaning "wait indefinitely").

Note that if you set CONNECT_DELAY to zero you get a lag check ping sent off
first thing in the server connection, this should be fixed.
This commit is contained in:
Kevin Easton
2015-05-12 22:39:30 +10:00
parent 72f5536121
commit 0f8280ed51
2 changed files with 3 additions and 5 deletions

View File

@@ -230,7 +230,7 @@ void close_unattached_servers(void)
long set_server_bits (fd_set *rd, fd_set *wr)
{
int i;
long timeout = 0;
long timeout = -1;
for (i = 0; i < number_of_servers; i++)
{
@@ -240,8 +240,6 @@ long set_server_bits (fd_set *rd, fd_set *wr)
* return in milliseconds.
*/
timeout = get_int_var(CONNECT_DELAY_VAR)*1000;
if(!timeout)
timeout = -1;
}
if (server_list[i].read > -1)