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

List:       kfm-devel
Subject:    Re: [PATCH] disable keep alive connections when using SSL
From:       Matthias Welwarsky <matze () stud ! fbi ! fh-darmstadt ! de>
Date:       2002-03-31 8:23:13
[Download RAW message or body]

Waldo Bastian wrote:

> 
> I think the better solution would be to make sure that non-idempotent
> methods (basically everything but GET) should start a new connection.
> (Patch attached)

I've attached a modified patch that also closes the connection before a GET 
if the request carries a query.

regards,
        Matze

-- 
Matthias Welwarsky
Fachschaft Informatik FH Darmstadt
Email: matze@stud.fbi.fh-darmstadt.de

"all software sucks equally, but some software is more equal"
["http_keepalive.patch" (text/x-diff)]

? http.cc.patch
? http_post.patch
? http_keepalive.patch
Index: http.cc
===================================================================
RCS file: /home/kde/kdelibs/kioslave/http/http.cc,v
retrieving revision 1.470
diff -u -3 -p -r1.470 http.cc
--- http.cc	2002/03/23 04:26:55	1.470
+++ http.cc	2002/03/31 08:23:12
@@ -920,6 +920,9 @@ void HTTPProtocol::mkdir( const KURL& ur
   m_request.cache = CC_Reload;
   m_request.doProxy = m_bUseProxy;
 
+  // Never use a keep-alive connection for MKDIR
+  httpCloseConnection();
+
   retrieveHeader( false );
 
   if ( m_responseCode == 201 )
@@ -939,6 +942,10 @@ void HTTPProtocol::get( const KURL& url 
   m_request.method = HTTP_GET;
   m_request.path = url.path();
   m_request.query = url.query();
+
+  // don't use keepalives if request carries a query
+  if (!m_request.query.isEmpty())
+      httpCloseConnection();
   
   QString tmp = metaData("cache");
   if (!tmp.isEmpty())
@@ -967,6 +974,9 @@ void HTTPProtocol::put( const KURL &url,
   m_request.cache = CC_Reload;
   m_request.doProxy = m_bUseProxy;
 
+  // Never use a keep-alive connection for PUT
+  httpCloseConnection();
+
   retrieveHeader( true );
 }
 
@@ -990,6 +1000,9 @@ void HTTPProtocol::copy( const KURL& src
   m_request.cache = CC_Reload;
   m_request.doProxy = m_bUseProxy;
 
+  // Never use a keep-alive connection for COPY
+  httpCloseConnection();
+
   retrieveHeader( false );
 
   // The server returns a HTTP/1.1 201 Created or 204 No Content on successful completion
@@ -1019,6 +1032,9 @@ void HTTPProtocol::rename( const KURL& s
   m_request.cache = CC_Reload;
   m_request.doProxy = m_bUseProxy;
 
+  // Never use a keep-alive connection for MOVE
+  httpCloseConnection();
+
   retrieveHeader( false );
 
   if ( m_responseCode == 201 )
@@ -1041,6 +1057,9 @@ void HTTPProtocol::del( const KURL& url,
   m_request.cache = CC_Reload;
   m_request.doProxy = m_bUseProxy;
 
+  // Never use a keep-alive connection for DELETE
+  httpCloseConnection();
+
   retrieveHeader( false );
 
   // The server returns a HTTP/1.1 200 Ok or HTTP/1.1 204 No Content
@@ -1065,6 +1084,9 @@ void HTTPProtocol::post( const KURL& url
   m_request.cache = CC_Reload;
   m_request.doProxy = m_bUseProxy;
 
+  // Never use a keep-alive connection for POST
+  httpCloseConnection();
+
   retrieveContent();
 }
 
@@ -1112,6 +1134,9 @@ void HTTPProtocol::davLock( const KURL& 
   // insert the document into the POST buffer
   m_bufPOST = lockReq.toCString();
 
+  // Never use a keep-alive connection for LOCK
+  httpCloseConnection();
+
   retrieveContent( true );
 
   if ( m_responseCode == 200 ) {
@@ -1147,6 +1172,9 @@ void HTTPProtocol::davUnlock( const KURL
   m_request.query = QString::null;
   m_request.cache = CC_Reload;
   m_request.doProxy = m_bUseProxy;
+
+  // Never use a keep-alive connection for UNLOCK
+  httpCloseConnection();
 
   retrieveContent( true );
 


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

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