[mod_python] apache.SERVER_RETURN and chunked encoding

Matthew Dennis mdennis at merfer.net
Wed Jan 2 17:57:33 EST 2008


I have a handler that streams large amounts of data.  Using chunked encoding
in necessary as the total size is not known upfront.  If there is an error
during the generation, I raise a apache.SERVER_RETURN (with
HTTP_PARTIAL_RESPONSE I believe).  The problem is that it looks like
mod_python and/or apache just appends some error html to the output stream
and continues with the chunked encoding like there was no error.  In other
words, some data chunks come from the server, then a chunk with the error
html in it, then the last chunk.  Thus, the client has no way of knowing
that the data is incomplete (not all of it was generated) and corrupt
(random html appended onto the end).  Am I just missing something, or is
this a bug?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20080102/2d18ed60/attachment.html


More information about the Mod_python mailing list