[Twisted-web] Problem with web2 HTTP server + authentication

Mircea Amarascu mircea at ag-projects.com
Thu May 31 11:09:19 EDT 2007


I'm using a web2 server with Basic authentication provided by 

There are cases when PUT requests with attachments from a client time 
out, as following:

1. When the client issues the first PUT request, without an 
Authentication header, the server responds with a 401 Unauthorized 
before receiving all the attachment (I see this in a TCP trace made with 
ngrep). I want to ask if this is the right behavior, I saw that Apache 
waits for the entire attachment before replying with 401.

The client I used sends the next PUT request right after the attachment, 
without an \r\n separator, e.g.

...<closing-xml-tag>PUT /resource HTTP/1.1
Host: ...

Is this normal ?

 Sometimes, when the attachment is bigger, some 10KB, the second PUT 
sent by the client (with the Authentication header present),  is not 
entirely received by the server, which times out as it waits for the 
entire attachment, with size = ContentLength. I've printed the data 
received on the TCP socket, in the doRead() method of 
twisted.internet.tcp.Connection, and I think sometimes in the processing 
the HTTPChannel or HTTPFactory stops reading the data, it close the 
connection for reading, or something like that.

Did anyone got a similar behavior?
Thank you.

More information about the Twisted-web mailing list