webdav search

Waldo Bastian bastian at kde.org
Fri Apr 26 20:22:44 BST 2002


On Friday 26 April 2002 08:47 am, Best, Jan-Pascal van wrote:
> Hi all,
>
> From the kfm-devel mailing list I guessed that you were the people
> working on the http ioslave. Please let
> me know if I should send this somewhere else
>
> From the kdepim/korganizer context, I've been working on
> support for exchange 2000 calendar servers with webdav.
> I'm made some changes to my local kdelibs tree which I think
> could be useful for more people.
>
> At the end of this message is a patch to http.c/http.h that
> - implements a davSearch() method
> - implements the SEARCH function as a special().
> - adds a "translate: f" header flag for all webdav GETs. This should
> be an option of some kind, but i don't know how and where. Any
> ideas?

What does it do? Anyway, you could pass it via metadata:

 if (m_protocol == "webdav" || m_protocol == "webdavs")
    davHeader = metaData("dav-header");

Then you can set it at the application site. E.g. something like:

SearchJob *job= KIO::search(...);
job->addMetaData("dav-header", "Translate: f\r\n");

> - add a content-type: text/xml for dav search in httpOpen().
> I guess this should be done somewhere else, but I don't know
> where. I've tried an addMetadata() in davSearch, but that
> didn't work

Any meta data that you set is passed back to the application, I assume this is 
to be send to the webdav server?

> - do not finish the header when there is still davData to send (this
> fixes a bug that just hasn't shown up yet)
> - Strange thing: I had to substract 1 from the content-size header
> before Exchange would swallow my search requests. Maybe something to
> do with zero-terminated strings?

Yes.. m_bufPOST is 8-bit data and you assign "request" to it which is a 
null-terminated QCString. You have to truncate that null from m_bufPOST. E.g. 
if (m_bufPOST.size()) m_bufPOST.truncate(m_bufPOST.size()-1);

> I'm also attaching searchjob.cpp and searchjob.h, which implement
> a SearchJob class, which looks a lot like the ListJob class.
>
> So, what do you think? Should this ultimately go into kdelibs,
> and what should be done before that?

Hamish Rodda wrote the webdav support so let's see what he has to say about 
the webdav parts. Apart from that it can go in as far as I am concerned.

> PS: This is the first thing I ever wrote for KDE. Let me know if
> I'm doing something stupid...

Looks quite good.

Cheers,
Waldo





More information about the kfm-devel mailing list