Subject: Issue with Greg's davlib.py module

From: [email-masked]
Date: Mon, 25 Jul 2005 17:27:17 +0200

Hi there. 

I hope I'm posting to the right mailing-list, I have an issue with Greg's 
davlib.py module (python).

The DAV class is based on the generic HTTPConnection class, I can 
successfully run some propfind, mkcol, put and delete command on my Apache 
server, but can only run 1 command per session or I get an fp.readline 
"Connection Reset by peer" issue in getresponse.

Therefore I have to add sesssion.close() and session.connect between each 
command I want to send to my server. This is annoying as performance goes 
down.

Is there any "flush" function I have missed, and any other explanation for 
this ? I would like to send as many command as wanted in the same server 
session.

Best regards
Arnaud

---

From: Elias Sinderson <[email-masked]>
Date: Mon, 25 Jul 2005 09:57:00 -0700

[email-masked] wrote:

> I hope I'm posting to the right mailing-list, I have an issue with 
> Greg's davlib.py module (python).

Well, technically speaking, this probably isn't the right list, however 
there is a great deal of WebDAV expertise to be found here.  :-)

> [...] I can successfully run some propfind, mkcol, put and delete 
> command on my Apache server, but can only run 1 command per session or 
> I get an fp.readline "Connection Reset by peer" issue in getresponse.

It sounds as if the 'Connection: Keep-Alive' header isn't being set . . .

> Therefore I have to add sesssion.close() and session.connect between 
> each command I want to send to my server. This is annoying as 
> performance goes down. [...]

Yes, this is the very reason Keep-Alive (and pipelining) was introduced 
- so that one wouldn't need to tear down connections between requests to 
the same server. There are several decent web pages that explain the 
details of the Keep-Alive header and pipelining of requests [1, 2], but 
I'd recommend starting with the HTTP specification [3] itself and then 
referring to other sites if you need more information.

FYI, I looked briefly at the davlib.py and saw no mention of the header. 
. . Also, one should note that, as useful as it is, davlib.py is not 
really distributed as an industrial strength DAV library.

Cheers,
Elias

[1] <http://www.io.com/~maus/HttpKeepAlive.html>
[2] <http://www.mozilla.org/projects/netlib/http/pipelining-faq.html>
[3] <http://www.faqs.org/rfcs/rfc2616.html>

---

From: Elias Sinderson <[email-masked]>
Date: Mon, 25 Jul 2005 10:20:37 -0700

Elias Sinderson wrote:

> I looked briefly at the davlib.py and saw no mention of the 
> [Connection: Keep-Alive] header [...]

Silly me, obviously the place to look for this is in Pythons httplib 
module. . . Check the docs on python.org for information on how to set 
arbitrary headers. Specifically, see 
<http://docs.python.org/lib/httpconnection-objects.html>, where 
putheader() is briefly discussed.

Cheers,
Elias

---

From: [email-masked]
Date: Tue, 26 Jul 2005 09:00:57 +0200

Thanks a lot Elias for your help, I will check that header you're talking 
about, and will inform Greg of this for his information.

Sorry for not posting in the right mailing-list, but couldn't find a more 
appropriate one.

Best regards
Arnaud

Elias Sinderson <[email-masked]> 
Envoyé par : [email-masked]
25/07/2005 19:20

A
[email-masked]
cc
[email-masked]
Objet
Re: Issue with Greg's davlib.py module

Cheers,
Elias