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

List:       kfm-devel
Subject:    [PATCH] Webdav bug
From:       Hamish Rodda <hamishrodda () ausdoctors ! net>
Date:       2002-03-21 14:02:19
[Download RAW message or body]

The attached patch solves two bugs. One caused a recursive redirect on some 
web servers, and the other is the disabling of webdav capability checking 
because it is not up to scratch. Please review and apply if possible (I'm 
away this weekend), hopefully in time for 3.0.

One question though, with a woring KURL called "url", shouldn't 
url.setPath(url.path(+1)) not interfere with the encoded/decoded status? I'm 
finding that /~test/ becomes /%7Etest/ when output from 
encodedPathAndQuery(), but without it, it remains as /~test/...?

Cheers,

Hamish.

["webdav-20020318.patch" (text/x-diff)]

Index: http.cc
===================================================================
RCS file: /home/kde/kdelibs/kioslave/http/http.cc,v
retrieving revision 1.464
diff -u -3 -p -r1.464 http.cc
--- http.cc     2002/03/14 02:51:43     1.464
+++ http.cc     2002/03/17 13:38:26
@@ -451,7 +451,11 @@ void HTTPProtocol::davStatList( const KU

   // WebDAV Stat or List...
   m_request.method = DAV_PROPFIND;
-  m_request.path = url.path();
+
+  if ( !stat && !m_request.url.path().endsWith("/") ) {
+    m_request.url.setPath(m_request.url.path(+1));
+  }
+
   m_request.query = QString::null;
   m_request.cache = CC_Reload;
   m_request.doProxy = m_bUseProxy;
@@ -774,7 +778,7 @@ void HTTPProtocol::davParseActiveLocks(

 long HTTPProtocol::parseDateTime( const QString& input, const QString& type )
 {
-  if ( type == "dateTime.tz" )
+  if ( type == "dateTime.tz" )
   {
     return KRFCDate::parseDateISO8601( input );
   }
@@ -842,25 +846,27 @@ QString HTTPProtocol::davProcessLocks()

 bool HTTPProtocol::davHostOk()
 {
+  // FIXME needs to be reworked. Switched off for now.
+  return true;
+
   // cached?
   if ( m_davHostOk )
   {
-    // Call a HTTP OPTIONS to find out if we're good...
     kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::davHostOk: true" << endl;
     return true;
   }
   else if ( m_davHostUnsupported )
   {
-    // Call a HTTP OPTIONS to find out if we're good...
     kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::davHostOk: false" << endl;
     davError( -2 );
     return false;
   }

+  // Call a HTTP OPTIONS to find out if we're good...
   m_request.method = HTTP_OPTIONS;

   // query the server's capabilities generally, not for a specific URL
-  m_request.path = "*";
+  m_request.url.setPath("*");
   m_request.query = QString::null;
   m_request.cache = CC_Reload;
   m_request.doProxy = m_bUseProxy;
@@ -883,12 +889,15 @@ bool HTTPProtocol::davHostOk()
       }
     }

-    if ( m_davHostOk )
+    if ( m_davHostOk ) {
+      kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::davHostOk: true" << endl;
       return true;
+    }
   }

   m_davHostUnsupported = true;
   davError( -2 );
+  kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::davHostOk: false" << endl;
   return false;
 }



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

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