Author rosslagerwall
Recipients giampaolo.rodola, loewis, pitrou, rosslagerwall
Date 2011-01-11.12:34:20
SpamBayes Score 2.83909e-06
Marked as misclassified No
Message-id <1294749266.49.0.872286980076.issue10882@psf.upfronthosting.co.za>
In-reply-to
Content
Just to be clear:

There are 3 different interfaces.
The basic one with the offset included & no headers/trailers is supported by all the platforms, including Linux.
The one with offset as None is only supported by Linux.
The one with headers/trailers/flags is supported by FreeBSD & OS X.

So it does provide a unique interface across all platforms while still providing the ability to access the native functionality.

Preferably, I'd like to see a thin wrapper like this remain and then have a sendfile() method added to the socket object which takes a file-like object (not a file descriptor) and optional headers/trailers. This method can then figure out how best to do it depending on the platform. (i.e. using TCP_CORK if necessary, etc). It could even be made to work with file-like objects that cannot be mmap()ed.

Why not put it straight in socket anyway? Well, some of the implementations allow sendfile() to have a normal fd as the output. Putting it in socket then would't make sense.
History
Date User Action Args
2011-01-11 12:34:26rosslagerwallsetrecipients: + rosslagerwall, loewis, pitrou, giampaolo.rodola
2011-01-11 12:34:26rosslagerwallsetmessageid: <1294749266.49.0.872286980076.issue10882@psf.upfronthosting.co.za>
2011-01-11 12:34:20rosslagerwalllinkissue10882 messages
2011-01-11 12:34:20rosslagerwallcreate