W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2001

RE: anyone working on WebDAV support for libwww?

From: Josh Watts <jwatts@pretorynet.com>
Date: Mon, 9 Jul 2001 10:39:44 -0400
Message-ID: <1EB9FCBE69B6154099DF0C4121D1503618A426@pnisvrms001.pretorynet.com>
To: <www-lib@w3.org>
> What do you do with the HTMethod enum in HTMethod.h?  Are you just
> adding bits to the enum for the new methods in WebDAV?
> 
> I worry that we'll run out of bits with this scheme.  The basic HTTP
> requires 10 bits.  The basic WebDAV protocol will add 7 more.
> 
> The extension DeltaV will add 11 more methods on top of that in turn.
> 
> That's 28 bits so far, out of 32 possible.
> 	<http://www.webdav.org/deltav/WWW10/deltav-intro.htm>
> 
> ...and what if we want DACL support, and what if... etc. etc.
> 
> Maybe we would want to replace the integer in question with some
> bigger bitset mechanism?

Good point. I'm not worried about adding methods to the HTMethod
enumeration. The enumeration values are local as are the functions that
operate on the enumeration. If we must, we can always redefine the
values and modify the functions that return method names and method
values. I think this is a much better solution than a bigger bitset
mechanism. 

> > Anyways, I've successfully added most WebDAV methods save 
> for a couple
> > and now I'm running into a minor problem. Some of the 
> WebDAV methods,
> > i.e. PROPPATCH, require that a message body be sent with the HTTP
> > request. It might look something like this:
> 
> [snip!]
> 
> > At first, I thought that creating a new function based on the POST
> > functions might work. However, since the server never sends 
> back a 100
> > Continue status the POST callback functions are not being called and
> > the message body isn't being sent. My question is this: how do I
> > attach a message body to a HTTP request? It seems like it should be
> > simple to do but I can't find an appropriate HTRequest_* function.
> 
> What happens if you call HTRequest_deleteExpect() just following
> HTRequest_new() (which puts in an Expect header at the end)?  Does it
> still wait for a 100 continue?
> 
> There is a time-out waiting for "100 Continue", which is default set
> to 2 secs, so it shouldn't hang there.
> 
> In <http://www.w3.org/Library/src/HTTP.html> it shows where the
> timeout can be adjusted, but it can't be adjusted below 20ms.  However
> the same document talks about this being "the default write
> mechanism".  Maybe there's some other write mechanism that can be
> used? 

As Monty Python would say, "And now for something completely different".
What I've ended up doing is adding the ability for the request to send a
message body. First, I've added  char* messageBody to the _HTRequest
structure and functions for adding and getting the message body. Second,
when the HTTP headers are being generated in HTTPGenMake (HTTPGen.c :
45), the message body is attached only if the message body has been set
(i.e. request->messageBody != NULL). I've tested my app against Apache's
WebDAV server and everything is working fine. As much as I wanted to use
a POST-like operation to send the message body, it simply doesn't
conform to the WebDAV RFC. 

That being said, there are some nitty gritty details that I want to
discuss for the purpose of soon getting my modifications added to the
base (probably be ready around the end of August). First, all of my
modifications are only present if WEBDAV is defined during compilation.
If WebDAV isn't defined, the WebDAV functions I've added to HTAccess.c
will return NO. I had to do this because the functions have to be
present in order to be exported by the DLL and I'm not sure how to
#ifdef a .def file. This might be a Windows only problem since it's been
a while since I built shared libraries in Unix.

I currently have the MKCOL, COPY, MOVE, PROPPATCH, and PROPFIND methods
implemented. I hope to have LOCK and UNLOCK implemented in the next two
weeks. 

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
Josh Watts  /  PretoryNet, Inc.
email: jwatts@pretorynet.com
phone: 770.752.3453
Received on Monday, 9 July 2001 10:40:16 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:39 GMT