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

List:       kde-commits
Subject:    icecream/services
From:       Dirk Mueller <mueller () kde ! org>
Date:       2006-06-06 21:43:34
Message-ID: 1149630214.123188.738.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 548925 by mueller:

fix performance problem


 M  +4 -11     comm.cpp  


--- trunk/icecream/services/comm.cpp #548924:548925
@@ -26,6 +26,8 @@
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <sys/select.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <netdb.h>
@@ -37,9 +39,7 @@
 #include <minilzo.h>
 #include <stdio.h>
 #include <sys/utsname.h>
-#include <netinet/tcp.h>
 
-
 #include "logging.h"
 #include "job.h"
 #include "comm.h"
@@ -236,13 +236,8 @@
 {
   const char *buf = msgbuf + msgofs;
   bool error = false;
-  int t;
   while (msgtogo)
     {
-      t = 1;
-#if defined(TCP_CORK)
-      setsockopt(fd, IPPROTO_TCP, TCP_CORK, &t, sizeof(t));
-#endif
       ssize_t ret = write (fd, buf, msgtogo);
       if (ret < 0)
         {
@@ -275,10 +270,6 @@
       msgtogo -= ret;
       buf += ret;
     }
-  t = 0;
-#if defined(TCP_CORK)
-  setsockopt(fd, IPPROTO_TCP, TCP_CORK, &t, sizeof(t));
-#endif
   msgofs = buf - msgbuf;
   chop_output ();
   return !error;
@@ -599,6 +590,8 @@
     }
   else
     {
+      int i = 1;
+      setsockopt(remote_fd, IPPROTO_TCP, TCP_NODELAY, (char*) &i, sizeof(i));
       if (connect (remote_fd, (struct sockaddr *) &remote_addr, sizeof (remote_addr)) < 0)
         {
           close( remote_fd );
[prev in list] [next in list] [prev in thread] [next in thread] 

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