[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/icecream-make-it-cool/services
From:       Dirk Mueller <mueller () kde ! org>
Date:       2007-07-16 16:55:28
Message-ID: 1184604928.838512.10572.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 688700 by mueller:

- code cleanup
- add log message when the local daemon hangs again


 M  +16 -14    comm.cpp  


--- branches/work/icecream-make-it-cool/services/comm.cpp #688699:688700
@@ -125,20 +125,20 @@
 	      /* The first time we read the remote protocol.  */
 	      protocol = 0;
 	      if (remote_prot < MIN_PROTOCOL_VERSION)
-		remote_prot = 0;
-	      else if (remote_prot > PROTOCOL_VERSION)
+                {
+		  remote_prot = 0;
+		  return false;
+                }
+
+	      if (remote_prot > PROTOCOL_VERSION)
 		remote_prot = PROTOCOL_VERSION; // ours is smaller
-	      if (remote_prot == 0)
-		return false;
-	      else
-		{
-		  vers[0] = remote_prot;
-		  //writeuint32 (remote_prot);
-		  writefull (vers, 4);
-		  if (!flush_writebuf (true))
-		    return false;
-		  protocol = -1 - remote_prot;
-		}
+
+	      vers[0] = remote_prot;
+	      //writeuint32 (remote_prot);
+	      writefull (vers, 4);
+	      if (!flush_writebuf (true))
+		  return false;
+	      protocol = -1 - remote_prot;
 	    }
 	  else if (protocol < -1)
 	    {
@@ -781,8 +781,10 @@
       int ret = select (fd + 1, &set, NULL, NULL, &tv);
       if (ret < 0 && errno == EINTR)
         continue;
-      if (ret == 0)
+      if (ret == 0) {
+        log_error() << "no response from local daemon within timeout." << endl;
         return false; /* timeout. Consider it a fatal error. */
+      }
       if (ret < 0)
         {
           log_perror("select in wait_for_protocol()");
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic