This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author phantal
Recipients Jim Crigler, blastwave, christian.heimes, petriborg, phantal, vstinner
Date 2020-08-04.03:19:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1596511164.87.0.716348770512.issue29269@roundup.psfhosted.org>
In-reply-to
Content
Christian, you did exactly what I needed.  Thank you.

I don't have the means to do a git bisect to find where it broke.  It wasn't a problem around 3.3 timeframe and I'm not sure when this sendfile stuff was implemented.

The man page for sendfile says "The sendfile() function does not modify the current file pointer of in_fd, (...)".  In other words the read pointer for the input descriptor won't be advanced.  They expect you to use it like this:

offset = 0;
do {
  ret = sendfile(in, out, &offset, len);
} while( ret < 0 && (errno == EAGAIN || errno == EINTR) );

... though making that change in posixmodule.c would break this test severely since the send & receive code is running on the same thread.

In posixmodule.c I don't see anything that attempts to return the number of bytes successfully sent.  Since the input file descriptor won't have its read pointer advanced, the variable "offset" must be set to the correct offset value, otherwise it just keeps reading the first 32k of the file that was generated for the test.
History
Date User Action Args
2020-08-04 03:19:24phantalsetrecipients: + phantal, vstinner, christian.heimes, petriborg, blastwave, Jim Crigler
2020-08-04 03:19:24phantalsetmessageid: <1596511164.87.0.716348770512.issue29269@roundup.psfhosted.org>
2020-08-04 03:19:24phantallinkissue29269 messages
2020-08-04 03:19:24phantalcreate