Re: sendfile() with zero size

2023-06-18 Thread Petro Karashchenko
The sendfile() description across the OSes is not the same. The FreeBSD version https://man.freebsd.org/cgi/man.cgi?sendfile(2) for example has words "The nbytes argument specifies how many bytes of the file should be sent, with 0 having the special meaning of send until the end of file has been re

Re: sendfile() with zero size

2023-06-18 Thread Fotis Panagiotopoulos
Hi Alan, Thanks for checking this out. The resources you linked indicate (correctly) that a TCP segment may have 0 data size. But also that usually this is not allowed for the users? I don't know, I don't intend to use this. However, sendfile (not the plain send) would be completely meaningless

Re: sendfile() with zero size

2023-06-18 Thread Alan C. Assis
Suggest, try to run you same application with this issue on Linux. I'm expecting at least a similar error on Linux. BR, Alan On 6/18/23, Alan C. Assis wrote: > Hi Fotis, > > On 6/18/23, Fotis Panagiotopoulos wrote: >> Hello, >> >> Due to a bug in my application, the code tried to use sendfile

Re: sendfile() with zero size

2023-06-18 Thread Alan C. Assis
Hi Fotis, On 6/18/23, Fotis Panagiotopoulos wrote: > Hello, > > Due to a bug in my application, the code tried to use sendfile() with zero > size. > > As I see, sendfile() will happily proceed, and it will block here: > https://github.com/apache/nuttx/blob/master/net/tcp/tcp_sendfile.c#L523 > > O

sendfile() with zero size

2023-06-18 Thread Fotis Panagiotopoulos
Hello, Due to a bug in my application, the code tried to use sendfile() with zero size. As I see, sendfile() will happily proceed, and it will block here: https://github.com/apache/nuttx/blob/master/net/tcp/tcp_sendfile.c#L523 Obviously, it will never manage to send any data (as the requested si