[mod_python] req.sendfile and the Content-length header

Aaron Gallagher habnabit at gmail.com
Sat Jun 9 01:46:00 EDT 2007


Is there any easy way to make req.sendfile use a content-length  
header instead of chunking the output? This is what I've been doing,  
and it's very fast, but I'm sure there's a more elegant way of doing it.

		st = open(req.filename)
		st.seek(0, 2)
		req.set_content_length(st.tell())
		st.close()
		req.sendfile(req.filename)

Aaron Gallagher
<habnabit at gmail.com>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20070608/be4d877e/attachment.html


More information about the Mod_python mailing list