Bug in Medusa / ZServer?
Hi. After ranting off in this list yesterday (Subject: Problem uploading large files), I did some more sleuthing. This is what I get to the console when I upload a large file to Zope in debug mode: 2000-03-07T20:55:16 ERROR(200) ZServer uncaptured python exception, closing channel <zhttp_channel connected 212.71.72.22:19518 at 606880 channel#: 21 requests:1> (exceptions.AttributeError:data [/opt/zope-mp3/ZServer/medusa/asyncore.py|poll|59] [/opt/zope-mp3/ZServer/medusa/asyncore.py|handle_read_event|291] [/opt/zope-mp3/ZServer/medusa/asynchat.py|handle_read|103] [/opt/zope-mp3/ZServer/medusa/http_server.py|collect_incoming_data|435] [/opt/zope-mp3/ZServer/medusa/http_server.py|collect_incoming_data|143] [/opt/zope-mp3/ZServer/HTTPServer.py|collect_incoming_data|300]) Is this a bug in Medusa or ZServer? Regards, Alexander Limi
Alexander Limi writes:
[/opt/zope-mp3/ZServer/medusa/http_server.py|collect_incoming_data|435] [/opt/zope-mp3/ZServer/medusa/http_server.py|collect_incoming_data|143] [/opt/zope-mp3/ZServer/HTTPServer.py|collect_incoming_data|300])
Is this a bug in Medusa or ZServer?
Who knows? Do a bit more digging and look at the code... Line 300 of HTTPServer.py is self.data.write(data) . The 'data' attribute is assigned to around line 190 in the same file, but only if a non-zero Content-Length header is found a few lines before. So, log the value of request.header, and see what's wrong. Is there a Content-Length header? Does it have a value of 0? Does the CONTENT_LENGTH regular expression miss it? (It might; the pattern seems too fragile, breaking if there's unexpected whitespace, as in 'Content-Length:<space><space>123'.) -- A.M. Kuchling http://starship.python.net/crew/amk/ "I feel disoriented." "This is the Disorientation Centre." "That makes sense." -- The Doctor and Sarah, in "The Android Invasion"
participants (2)
-
Alexander Limi -
Andrew M. Kuchling