(replace existing check which suffered from ToC-ToU race condition) enhances logic from 2015 commitmaster
593599f1and avoids repeated fstat() checks when sending large files For mmap(), lighttpd catches SIGBUS if file is (externally) truncated and lighttpd attempts to access bytes in a read-only mapping more than a memory page boundary following the end of the file. For sendfile(), lighttpd returns an error if sendfile() reports no error and that no bytes have been sent after lighttpd attempts to send a non-zero number of bytes.
2 changed files with 13 additions and 8 deletions
Reference in new issue