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

List:       kde-core-devel
Subject:    Re: kio_http, persistent connections
From:       Dirk Mueller <mueller () kde ! org>
Date:       2001-06-05 11:44:59
[Download RAW message or body]

On Mon, 04 Jun 2001, Dawit Alemayehu wrote:

> It is not only a problem for the servers, but also "possibly" the client because of
> the way TCP works.  If the requests are too small some TCP stack implementations
> might hold off on sending the request until they have the minimum number of enough
> packets to trigger transmission.  This of course contributes to the degrading of page
> retrieval speed.

well, that part is easy: 

--- http.cc     2001/05/30 21:20:33     1.364
+++ http.cc     2001/06/05 11:43:43
@@ -28,6 +28,7 @@
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <sys/wait.h>
+#include <netinet/tcp.h>
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>         // Needed on some systems.
 #endif
@@ -470,6 +471,9 @@ HTTPProtocol::http_openConnection()
         }
         m_sock = ks.fd();
 
+        int on = 1;
+        int r = setsockopt( m_sock, SOL_TCP, TCP_NODELAY, &on, sizeof( on ) 
);
+
         // SSL proxying requires setting up a tunnel through the proxy 
         // with the CONNECT directive.
 #ifdef DO_SSL


Dirk

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

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