Rework the calculation of the select timeout in io() to be based on absolute wake time
An absolute wake time is now calculated and updated by set_server_bits(), TimerTimeout() and tclTimerTimeout(). This is then used to calculate the actual select() timeout, instead of having those functions calculate a relative timeout value themselves. This significantly simplifies those functions, since the underlying values tend to be recorded as absolute times. It also allows us to disentangle tclTimeTimeout from TimerTimeout(), and move the responsibility for calculating the QUEUE_SENDS wake time from TimerTimeout() to set_server_bits() where it belongs. The QUEUE_SENDS and CONNECT_DELAY wake up times will also now be correctly calculated, based on the last sent time and connect time respectively.
This commit is contained in:
@@ -19,6 +19,7 @@ typedef struct {
|
||||
|
||||
extern cmd_t C_msg[];
|
||||
extern cmd_t C_dcc[];
|
||||
void tclTimerTimeout(struct timeval *wake_time);
|
||||
int check_tcl_dcc (char *, char *, char *, int);
|
||||
|
||||
void tcl_command (char *, char *, char *, char *);
|
||||
|
||||
Reference in New Issue
Block a user