3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-26 13:59:44 +01:00
Commit Graph

7 Commits

Author SHA1 Message Date
Daniel Oaks
ac99e82192 Fix build issues 2018-01-22 17:57:38 +10:00
Daniel Oaks
d09f085b1a Add very initial RESUME cap and command 2018-01-22 17:57:38 +10:00
Shivaram Lingamneni
d8d1705035 refactor idle timeouts again 2017-12-06 23:23:25 -05:00
Shivaram Lingamneni
ad1e00629b fix a race condition in idle timeouts
squigz on freenode reported an issue where bots were responding to PING
on time, but were occasionally being timed out regardless. This was a race
condition: timeout was detected as idleTime >= it.quitTimeout, but if
the client responded promptly to its PING message and sent no further messages,
but the main loop subsequently slept for longer than expected (i.e., significantly
longer than quitTimeout), this condition would be met through no fault of the
client's.

The fix here is to explicitly track the last time the ping was sent, then test
!lastSeen.After(lastPinged) instead (making use of time.Time's monotonicity).
It is sufficient that the measurement of lastPinged happens-before the PING is sent.
2017-12-02 20:30:26 -05:00
Shivaram Lingamneni
52b0fb71e7 refactor ClientManager 2017-11-22 05:09:38 -05:00
Shivaram Lingamneni
c026cc5ab6 review fixes
* move constant definitions
* always give the client at least quitTimeout to respond to ping,
  even if registerTimeout or quitTimeout are longer than idleTimeout
2017-10-15 22:37:36 -04:00
Shivaram Lingamneni
e540fde816 refactor idle timeouts 2017-10-15 19:46:25 -04:00