[mod_python] Re: Chunked encoding

Dan Eloff dan.eloff at gmail.com
Sat Feb 18 17:14:50 EST 2006

I'm curious about this "chunked encoding" what does that mean? I output all
my pages in my handler as a single string, so I have a sort of interest in
understanding what the write method does. If I'm to take a wild guess at how
the below works, you set the content length so that mod_python realizes when
it recieves your data string that no more is coming and it doesn't need to
copy the string into a buffer, it can just keep a reference to it? And
somehow the act of buffering the data as opposed to writing it immediately
causes mod_python not to emply this "chunked encoding"?

It'd be great if someone explained this to me :)


On 2/15/06, Lars Eriksen <downgrade at gmx.org> wrote:
> Yes, there is :-) RTFM, I guess ...
> from mod_python.util import *
> from mod_python import apache
> def handle(req):
>     data = 'No chunking involved.' * 1024
>     req.set_content_length(len(data))
>     req.write(data, 0)
>     req.flush()
>     return apache.OK
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060218/03799b02/attachment.html

More information about the Mod_python mailing list