Index: src/daemon/response.c =================================================================== --- src/daemon/response.c (revision 15147) +++ src/daemon/response.c (working copy) @@ -272,7 +272,10 @@ struct MHD_Response *response = cls; (void) lseek (response->fd, pos + response->fd_off, SEEK_SET); - return read (response->fd, buf, max); + ssize_t n = read (response->fd, buf, max); + if (n == 0) return MHD_CONTENT_READER_END_OF_STREAM; + if (n < 0) return MHD_CONTENT_READER_END_WITH_ERROR; + else return n; }