Giampaolo Rodola' <g.rod...@gmail.com> added the comment:

On a second thought I have two complaints.

There is no reason to return the file offset, also because this is only 
supported on Linux. On all other platforms we are calculating the file offset 
by making a sum of offset + number of bytes sent. Despite this would normally 
work it no longer makes sense when headers/trailers arguments are specified.

>>> sendfile(in, out, offset, 4096, headers=[b"xxxx"])
(5000, 5000)

In this case the right offset is supposed to be 4096.
We might adjust this in the code but in my opinion knowing the file offset is 
not really necessary as what the user really needs is the number of bytes sent, 
as when using socket.send().

My second complaint is about headers/trailers data type.
Currently we are passing a sequence of buffers (tipically a list) but I think 
we should pass plain bytes instead.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10882>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to