From kfm-devel Sun Mar 17 13:52:42 2002 From: Hamish Rodda Date: Sun, 17 Mar 2002 13:52:42 +0000 To: kfm-devel Subject: Webdav problems X-MARC-Message: https://marc.info/?l=kfm-devel&m=101637324716770 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------Boundary-00=_UJE4UT23GNL0YMOWC15D" --------------Boundary-00=_UJE4UT23GNL0YMOWC15D Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, Well, the request asking for / instead of // is (so= rt=20 of) a bug. I have attached a patch which fixes this particular case. Plea= se=20 test this. The fact that the redirection causes an assert to be hit is probably not = a=20 good thing... is a call to redirection() during a listDir() or stat()=20 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 We= bDAV=20 capabale, as the redirection() call can be triggered by this too. However= =20 there are bigger problems as servers only return a "DAV:" line in respons= e to=20 the OPTIONS method when the particular resource (file or directory) is=20 dav-enabled, not when the server itself supports WebDAV. The consequence = of=20 this is that (for now) the nice "The server does not support webdav" erro= r=20 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 sla= ve,=20 or should I write a basic one myself? (will have to wait for 3.1 anyway, = of=20 course). On a semi-related topic, in the m_request struct for the http ioslave, wh= en=20 should the path variable be used as compared to the url variable? Cheers, Hamish. On Sat., March 16 2002, Taras 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=3Dwebdav://glek.net/~taras/ >locationBarURL=3Dwebdav:/ >/glek.net/~taras/ >konqueror: KonqMainWindow::setLocationBarURL: url =3D >webdav://glek.net/~taras/ >kio (KDirLister): [bool KDirLister::openURL(const KURL &, bool =3D false= , >bool =3D fal >se)] webdav://glek.net/~taras/ keep=3Dfalse reload=3Dfalse >kio (KDirListerCache): [void KDirListerCache::listDir(KDirLister *, >const KURL &, >bool, bool)] 0x81ce5e0 url=3Dwebdav://glek.net/~taras keep=3Dfalse >reload=3Dfalse >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=3D32 >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=3Dtrue bOthersFollowed=3Dfalse >returning true >konqueror: Container [KonqFrameContainer pointer (0x8198c98) to unnamed >widget, ge >ometry=3D700x480+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) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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=3D10, max=3D10" >kio_http: (774) "Connection: Keep-Alive" >kio_http: (774) "Content-Type: text/html; charset=3Diso-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 =3D >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 =3D 2 >KCrash: Application Name =3D konqueror path =3D pid =3D 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. --------------Boundary-00=_UJE4UT23GNL0YMOWC15D Content-Type: text/x-diff; charset="iso-8859-1"; name="webdav-20020318.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="webdav-20020318.patch" 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; } --------------Boundary-00=_UJE4UT23GNL0YMOWC15D--