Hi Alexander, On 19.01.2017 19:02, Alexander Couzens wrote: >> Looks like you are sending 4GiB-1 file on 32bit OS and sendfile failed >> as mmap operations are not supported on such file. >> Fallback to ordinal read()/send() should be fixed in >> b3f1a958ce613f304234ecb6506976db26c117dc. >> Could you retry with latest git version? > Sorry, I couldn't do that, because I'vn't found a way to reproduce > it in the same environment, but I found some part of the problem. > > nodogsplash is giving a fd of a directory to libmicrohttpd and lseek() > was used to define the size of the file without checking the return > value resulting in the size = 4GiB-1.
FD of directory to create a response? It is not allowed, only file FD can be used for response. Anyway, MHD doesn't use lseek() to determine file size and all lseek() results are checked against errors. Did you mean that lseek() is used somewhere else without checking result? > But anyway, mmap on a directory doesn't look like a good idea. > > On my working machine a simple test is not going into a indef loop. > Passing a directory resulting in a direct close of the connection (no > headers, no data). Correct. If callback is unable to provide any data - MHD close connection directly. In case of response with file FD - callback is file reader. -- Best Wishes, Evgeny Grin
signature.asc
Description: OpenPGP digital signature
