don't wait for a message body that will never come. fixes 659

git-svn-id: file:///home/svn/framework3/trunk@7748 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2009-12-08 02:26:37 +00:00
parent 47fdec6ab3
commit 7427640fb0
1 changed files with 9 additions and 0 deletions

View File

@ -278,6 +278,15 @@ protected
# no chunked transfer header, pretend this is the entire
# buffer and call it done
self.body_bytes_left = self.bufq.length
elsif(not self.transfer_chunked and not self.headers['Content-Length'])
# RFC 2616 says: "The presence of a message-body in a request
# is signaled by the inclusion of a Content-Length or
# Transfer-Encoding header field in the request's
# message-headers."
#
# So if we haven't seen either a Content-Length or a
# Transfer-Encoding header, there shouldn't be a message body.
self.body_bytes_left = 0
else
# Otherwise we need to keep reading until EOF
self.body_bytes_left = -1