changeset 1570:3d4c85664dad

Reduce the CPU usage when the server is unreachable Based on a patch from Alex Gordeev
author Mikael Berthe <mikael@lilotux.net>
date Sat, 11 Apr 2009 12:05:27 +0200
parents 21c553e4bfb9
children 481b60da99c9
files mcabber/src/jabglue.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/jabglue.c	Tue Mar 10 20:48:51 2009 +0100
+++ b/mcabber/src/jabglue.c	Sat Apr 11 12:05:27 2009 +0200
@@ -264,11 +264,13 @@
       scr_DoUpdate();
     }
     // If we're not connected, sleep for a while...
-    select(maxfd + 1, &fds, NULL, NULL, &tv);
-    if (!online)
+    if (!online) {
+      select(1, &fds, NULL, NULL, &tv);
       check_connection();
-    else
+    } else {
+      select(maxfd + 1, &fds, NULL, NULL, &tv);
       jab_start(jc);
+    }
     return;
   }