[mod_python] Interest in sendfile from mod_python?

Greg Stein gstein at lyra.org
Sun Nov 10 17:05:40 EST 2002

On Fri, Nov 08, 2002 at 11:24:56AM -0800, Conrad Steenberg wrote:
> The Linux and FreeBSD (I think) sendfile calls make this very easy and
> efficient in Apache itself, but there is no way to control this from
> within mod_python as far as I can see.

In Apache 2.0, the Python code needs to construct a FILE bucket and shove
that into the output filter stack. Assuming that it doesn't get processed by
mod_includes or somesuch on the way through the filters, then it will hit
the network output filter and be sendfile'd.

> My solution was to build a Python sendfile module (using code from the
> Medusa server, under the Python license), and create a patch for
> mod_python to get the request file-descriptor to pass to the sendfile
> call.

The file descriptor is private info. Modules should never access it.

All that said: I'm not sure if mod_python allows you to construct buckets
right now. Grisha could answer that in a jiffy...


Greg Stein, http://www.lyra.org/

More information about the Mod_python mailing list