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

List:       kfm-devel
Subject:    Webdav problems
From:       Hamish Rodda <meddie () yoyo ! cc ! monash ! edu ! au>
Date:       2002-03-17 13:52:42
[Download RAW message or body]

Hi,

Well, the request asking for /<directory> instead of /<directory>/ is (sort 
of) a bug. I have attached a patch which fixes this particular case. Please 
test this.

The fact that the redirection causes an assert to be hit is probably not a 
good thing... is a call to redirection() during a listDir() or stat() 
allowed? If so the assert might be in error.

As a side effect, I have had to disable checking to see if the host is WebDAV 
capabale, as the redirection() call can be triggered by this too. However 
there are bigger problems as servers only return a "DAV:" line in response to 
the OPTIONS method when the particular resource (file or directory) is 
dav-enabled, not when the server itself supports WebDAV. The consequence of 
this is that (for now) the nice "The server does not support webdav" error 
message is replaced with "the file or directory does not exist."

Is there a "nice" way to cache arbitrary data on a url basis within a slave, 
or should I write a basic one myself? (will have to wait for 3.1 anyway, of 
course).

On a semi-related topic, in the m_request struct for the http ioslave, when 
should the path variable be used as compared to the url variable?

Cheers,

Hamish.

On Sat., March 16 2002, Taras <judge@uvic.ca> Wrote:
>Hello,
>I'm trying to get webdav to work, but for the last few weeks kde3 has
>been crashing on me.
>
>When I type in webdav://glek.net/~taras/ it just goes to hell. I think
>the webdav kioslave gets confused on redirects(why the hell does it keep
>trying to remove the last /) and then is causing KDirlister to fail in
>an ASSERT.
>But this is just speculation :).
>
>Please take a look at this problem, its really annoying, and looks
>pretty major. I tried to debug it myself, but my lack of kde experience
>isn't letting me go far.
>
>Here is the debug output
>I'm sure you can generate the backtrace yoruself...it doesnt look too
>useful.
>
>konqueror: KonqView::openURL url=webdav://glek.net/~taras/
>locationBarURL=webdav:/
>/glek.net/~taras/
>konqueror: KonqMainWindow::setLocationBarURL: url =
>webdav://glek.net/~taras/
>kio (KDirLister): [bool KDirLister::openURL(const KURL &, bool = false,
>bool = fal
>se)] webdav://glek.net/~taras/ keep=false reload=false
>kio (KDirListerCache): [void KDirListerCache::listDir(KDirLister *,
>const KURL &,
>bool, bool)] 0x81ce5e0 url=webdav://glek.net/~taras keep=false
>reload=false
>kio (KDirListerCache): [void KDirListerCache::stop(KDirLister *)]
>0x81ce5e0
>kio (KDirListerCache): [void KDirListerCache::forgetDirs(KDirLister *)]
>0x81ce5e0
>kio (KDirListerCache): listDir: Entry not in cache or reloaded:
>webdav://glek.net/
>~taras
>libkonq: gridXValue: 82sz=32
>mcop warning: user defined signal handler found for SIG_PIPE, overriding
>konqueror: KonqKfmIconView::slotRenderingFinished()
>konqueror: KonqMainWindow::setCaption(webdav://glek.net/~taras/)
>libkonq: ## addToHistory: webdav://glek.net/~taras/Typed URL:
>webdav://glek.net/~t
>aras/, Title:
>konqueror: KonqMainWindow::openView ok=true bOthersFollowed=false
>returning true
>konqueror: Container [KonqFrameContainer pointer (0x8198c98) to unnamed
>widget, ge
>ometry=700x480+0+0]
>konqueror:   KonqFrame containing view 0x81afec8 part 0x81b03b0 whose
>widget is a
>KonqIconViewWidget
>konqueror:   Null child
>kdeinit: Got EXEC_NEW 'kio_http' from launcher.
>kio (KLauncher): kio_http (pid 774) up and running.
>kio_http: (774) ============ Sending Header:
>kio_http: (774) OPTIONS /~taras HTTP/1.1
>kio_http: (774) Connection: Keep-Alive
>kio_http: (774) Pragma: no-cache
>kio_http: (774) Cache-control: no-cache
>kio_http: (774) Accept: text/*, image/jpeg, image/png, image/*, */*
>kio_http: (774) Accept-Encoding: x-gzip, gzip, identity
>kio_http: (774) Accept-Charset: iso-8859-1, utf-8, *
>kio_http: (774) Accept-Language: en
>kio_http: (774) Host: glek.net
>kio_http: (774) ============ Received Response:
>kio_http: (774) "HTTP/1.1 301 Moved Permanently"
>kio_http: (774) "Date: Fri, 15 Mar 2002 21:45:19 GMT"
>kio_http: (774) "Server: Apache/2.0.32 (Unix) mod_ssl/3.0a0
>OpenSSL/0.9.6b DAV/2 P
>HP/4.1.2"
>kio_http: (774) "Location: http://glek.net/~taras/"
>kio_http: (774) "Content-Length: 298"
>kio_http: (774) "Keep-Alive: timeout=10, max=10"
>kio_http: (774) "Connection: Keep-Alive"
>kio_http: (774) "Content-Type: text/html; charset=iso-8859-1"
>kio_http: (774): --empty--
>kio (KDirListerCache): [void KDirListerCache::slotRedirection(KIO::Job
>*, const KU
>RL &)] webdav://glek.net/~taras -> http://glek.net/~taras/
>konqueror: KonqMainWindow::setLocationBarURL: url =
>http://glek.net/~taras/
>kio (KIOJob): error 63 The server does not support the WebDAV protocol.
>kio (KDirListerCache): [void KDirListerCache::slotResult(KIO::Job *)]
>finished lis
>ting webdav://glek.net/~taras
>ASSERT: "listers" in kdirlister.cpp (744)
>KCrash: crashing.... crashRecursionCounter = 2
>KCrash: Application Name = konqueror path = <unknown> pid = 773
>
>
>Well, here is the backtrace
>(no debugging symbols found)...(no debugging symbols found)...
>0x41103ee9 in wait4 () from /lib/libc.so.6
>#0  0x41103ee9 in wait4 () from /lib/libc.so.6
>#1  0x4118150c in __check_rhosts_file () from /lib/libc.so.6
>#2  0x40f91686 in waitpid () from /lib/libpthread.so.0
>#3  0x40780fdc in KCrash::defaultCrashHandler ()
>   from /usr/local/kde/lib/libkdecore.so.4
>#4  0x40f8f5d4 in sigaction () from /lib/libpthread.so.0
>#5  0x41085818 in sigaction () from /lib/libc.so.6
>#6  0x40350309 in KDirListerCache::qt_invoke ()
>   from /usr/local/kde/lib/libkio.so.4
>#7  0x40a75a47 in QObject::activate_signal ()
>   from /usr/lib/qt3/lib/libqt-mt.so.3
>#8  0x4026031a in KIO::ListJob::entries () from
>/usr/local/kde/lib/libkio.so.4
>#9  0x40248fd4 in KIO::ListJob::slotListEntries ()
>   from /usr/local/kde/lib/libkio.so.4
>#10 0x40260571 in KIO::ListJob::qt_invoke ()
>   from /usr/local/kde/lib/libkio.so.4
>#11 0x40a75a47 in QObject::activate_signal ()
>   from /usr/lib/qt3/lib/libqt-mt.so.3
>#12 0x40230898 in KIO::SlaveInterface::listEntries ()
>   from /usr/local/kde/lib/libkio.so.4
>#13 0x4022cf35 in KIO::SlaveInterface::dispatch ()
>   from /usr/local/kde/lib/libkio.so.4
>#14 0x4022c556 in KIO::SlaveInterface::dispatch ()
>   from /usr/local/kde/lib/libkio.so.4
>#15 0x40229b77 in KIO::Slave::gotInput () from
>/usr/local/kde/lib/libkio.so.4
>#16 0x4022be9f in KIO::Slave::qt_invoke () from
>/usr/local/kde/lib/libkio.so.4
>#17 0x40a75a47 in QObject::activate_signal ()
>   from /usr/lib/qt3/lib/libqt-mt.so.3
>#18 0x40a75b5a in QObject::activate_signal ()
>   from /usr/lib/qt3/lib/libqt-mt.so.3
>#19 0x40d0e434 in QSocketNotifier::activated ()
>   from /usr/lib/qt3/lib/libqt-mt.so.3
>#20 0x40a8af5d in QSocketNotifier::event () from
>/usr/lib/qt3/lib/libqt-mt.so.3
>#21 0x40a21256 in QApplication::internalNotify ()
>   from /usr/lib/qt3/lib/libqt-mt.so.3
>#22 0x40a210f4 in QApplication::notify () from
>/usr/lib/qt3/lib/libqt-mt.so.3
>#23 0x406ea825 in KApplication::notify ()
>   from /usr/local/kde/lib/libkdecore.so.4
>#24 0x409d1643 in sn_activate () from /usr/lib/qt3/lib/libqt-mt.so.3
>#25 0x409d1e07 in QApplication::processNextEvent ()
>   from /usr/lib/qt3/lib/libqt-mt.so.3
>#26 0x40a22664 in QApplication::enter_loop ()
>   from /usr/lib/qt3/lib/libqt-mt.so.3
>#27 0x409d16b6 in QApplication::exec () from
>/usr/lib/qt3/lib/libqt-mt.so.3
>#28 0x40048964 in main () from /usr/local/kde/lib/konqueror.so
>#29 0x41074311 in __libc_start_main () from /lib/libc.so.6
>
>
>Good luck in fixing this.

["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