Handle timers which should be executed right away
diff --git a/common/rfb/Timer.cxx b/common/rfb/Timer.cxx
index efae36e..e2aefac 100644
--- a/common/rfb/Timer.cxx
+++ b/common/rfb/Timer.cxx
@@ -129,6 +129,9 @@
   gettimeofday(&now, 0);
   stop();
   timeoutMs = timeoutMs_;
+  // The rest of the code assumes non-zero timeout
+  if (timeoutMs <= 0)
+    timeoutMs = 1;
   dueTime = addMillis(now, timeoutMs);
   insertTimer(this);
 }