the problem is with the server_dump function. for some reason, it doesn't send the buffer completely. you can verify this by outputting the buffer length before writing
19 июня 2026 г. 04:14:00 GMT+03:00, Lloyd <[email protected]> пишет: >I do suspect a bug in the errdocs code but unrelated to file size. > >server_abort_http() uses strlen() to re-calculate the Content-Length of the >errdoc. This is very wrong because embedded NULs in the file body will cause >a truncated value. A NUL at 40k will cause it to be truncated as such. > >AFAIK 0x00 are valid characters in Unicode response bodies. > >read_errdoc() should be modified to return the number of bytes read from >fstat(). It does calculate this but the value is discarded and not returned. > >Oddly the comments for read_errdoc() do not match the code that follows, >because it returns a pointer to the file contents, not a length: > >/* > * return -1 on failure, strlen() of read file otherwise. > * body is NULL on failure, contents of file with trailing \0 otherwise. > */ > >The mismatched documentation has been there since the original commit. > >Regards >Lloyd > >Фёдор <[email protected]> wrote: > >> error in errdocs in httpd. when creating a large html page for an error, it >> truncates it to 40 kilobytes. >
