aboutsummaryrefslogtreecommitdiffstats
path: root/win/rfb_win32/SocketManager.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-03 09:24:51 +0100
committerPierre Ossman <ossman@cendio.se>2024-06-19 16:39:07 +0200
commitbf286837db638a67bde0ab9be0baa621f863b8d5 (patch)
treeab74492ab53922a216b338a1f1f84312439552d4 /win/rfb_win32/SocketManager.cxx
parent37cf0ffaba7f4e855a909f57adf72da43c0ac275 (diff)
downloadtigervnc-bf286837db638a67bde0ab9be0baa621f863b8d5.tar.gz
tigervnc-bf286837db638a67bde0ab9be0baa621f863b8d5.zip
Stop treating "0" as "no timeouts"
It is much more sane to treat "0" as "a timer is ready NOW", so let's change to using -1 as the invalid timeout value.
Diffstat (limited to 'win/rfb_win32/SocketManager.cxx')
-rw-r--r--win/rfb_win32/SocketManager.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/win/rfb_win32/SocketManager.cxx b/win/rfb_win32/SocketManager.cxx
index 027536fd..c2fba0fb 100644
--- a/win/rfb_win32/SocketManager.cxx
+++ b/win/rfb_win32/SocketManager.cxx
@@ -165,7 +165,9 @@ void SocketManager::setDisable(network::SocketServer* srvr, bool disable)
int SocketManager::checkTimeouts() {
int timeout = EventManager::checkTimeouts();
- soonestTimeout(&timeout, Timer::checkTimeouts());
+ int nextTimeout = Timer::checkTimeouts();
+ if (nextTimeout >= 0 && nextTimeout < timeout)
+ timeout = nextTimeout;
std::list<network::Socket*> shutdownSocks;
std::map<HANDLE,ConnInfo>::iterator j, j_next;