Re: WebDav support

Hi!

Thanks for your bug report! (and sorry for the delay in the answer!)  

I've changed the code, and also make some other changes that Jose K. ask 
me... Indeed, there is no big deal, I just separated   WebDAV and 
extension methods modifications. Now, we may chose between them using 
"--with-dav" and "--with-extensions" options...  For those who wants 
just one of them.. :)
The code is available in the same URL 
http://gnome.inrialpes.fr:1959/src/libwwwDAV.tar.gz

Best regards,

Manuele



Gregory Begelman wrote:

>Hi,
>
>  I've found and fixed bug in sending request body. Please check if  the bug fix corresponds to your concept.
>
>Best regards,
>Gregory
>
>-----Original Message-----
>From: Manuele Kirsch Pinheiro
>[mailto:Manuele.Kirsch_Pinheiro@inrialpes.fr]
>Sent: Mon, March 04, 2002 4:49 PM
>To: Gregory Begelman
>Cc: www-lib@w3.org
>Subject: Re: WebDav support
>
>
>Hi!
>
>Gregory Begelman wrote:
>
>>Hello,
>>
>> I've found a discussion concerning this topic but it is pretty old. Is such functionality added to libwww?
>>
>At this exactly moment, it seems to me that there isn't a support for 
>WebDAV in Libwww CVS code base. But, if you like, I built a WebDAV 
>module for Libwww. It implements all new methods proposed in RFC 2518 
>(lock, unlock, proppatch, propfind, etc). If you wants to try it, it's 
>available at http://gnome.inrialpes.fr:1959/src/libwwwDAV.tar.gz.
>
>About your other question :
>
>>Hello,
>>
>> I need to work with server with "HTTP-like" protocol but request names are not as in HTTP standart, e.g. there is not such a thing like GET or POST but instead there is MAKE_XXX, e.g.
>> Can I add new methods to libwww?
>>
>>Best regards,
>>Gregory
>>
>When I introduced the WebDAV module in Libwww, I've also introduce some 
>"extension methods". This methods are "undefined" methods, that the 
>applications may set. So, if your application needs some method that the 
>Libwww doesn't known, you may "register" the new methods using this new 
>feature. I think that feature may help you...
>
>If you decided to try it, please, repport me any bug that you found...  :-)
>
>
>Best regards,
>
>Manuele
>
>
>
>------------------------------------------------------------------------
>
>--- ../../../libwwwDAV/HTTPGen.c	Tue Mar  5 19:26:27 2002
>+++ HTTPGen.c	Tue Mar  5 19:30:38 2002
>@@ -27,6 +27,8 @@
> #define PUTS(s)		(*me->target->isa->put_string)(me->target, s)
> #define PUTBLOCK(b, l)	(*me->target->isa->put_block)(me->target, b, l)
> 
>+#define LINEBUF_LENGTH 256
>+
> struct _HTStream {
>     const HTStreamClass *	isa;
>     HTStream *		  	target;
>@@ -46,7 +48,7 @@
> */
> PRIVATE int HTTPGenMake (HTStream * me, HTRequest * request)
> {
>-    char linebuf[256];				/* @@@ */
>+    char linebuf[LINEBUF_LENGTH];				/* @@@ */
>     char crlf[3];
>     HTGnHd gen_mask = HTRequest_gnHd(request);
>     *crlf = CR; *(crlf+1) = LF; *(crlf+2) = '\0';
>@@ -211,10 +213,19 @@
>     {
>        char * body = HTRequest_messageBody (request);
>        if (body && *body) {
>-	   HTTRACE(STREAM_TRACE, "HTTPGen..... Adding message body  \n");
>-           sprintf (linebuf,"%s",body);
>-           PUTBLOCK (linebuf, (int) strlen (linebuf));
>-           HT_FREE (body);	   
>+	 int bodylen = strlen (body);
>+	 int i = 0;
>+	 HTTRACE(STREAM_TRACE, "HTTPGen..... Adding message body  \n");
>+	 for (; i < bodylen / LINEBUF_LENGTH; ++i) {
>+	   memcpy (linebuf, body + LINEBUF_LENGTH * i, LINEBUF_LENGTH);
>+	   PUTBLOCK (linebuf, LINEBUF_LENGTH);
>+	 }
>+	 if (bodylen % LINEBUF_LENGTH) {
>+	   memcpy (linebuf, body + bodylen - bodylen % LINEBUF_LENGTH, 
>+		   bodylen % LINEBUF_LENGTH);
>+	   PUTBLOCK (linebuf, bodylen % LINEBUF_LENGTH);
>+	 }
>+	 HT_FREE (body); 
>        }
>     }
> #endif
>
> diff.src.HTTPGen.c.txt
>
> Content-Description:
>
> diff.src.HTTPGen.c.txt
> Content-Type:
>
> text/plain
> Content-Encoding:
>
> base64
>
>

Received on Tuesday, 12 March 2002 13:05:38 UTC