On Mon, Jan 31, 2005 at 10:36:27PM +0100, Joachim Berdal Haga wrote: > (forgot to cc bugs.debian.org originally, this is a copy fyi) > > Joachim Berdal Haga wrote: > >I tried 1.9 which works fine, thanks! > > Correction; range handling works fine. However, for me 1.9 seems to loop > endlessly (using all cpu). Strace of process shows > > sendfile64(1, 3, [1151365], 2147483648) = 0 > sendfile64(1, 3, [1151365], 2147483648) = 0 > etc. > > I haven't investigated much further but it happens on files above a > certain size (robots.txt worked fine; a 220kB file loops consistently but > not when I transfer only the first 10kB via range request) and it happens > at the end of the download.
Yes, the sendfile while loop loops indefinitely. Undoing this recent change fixes this, see below. Thanks for testing and letting me know, I'll wait for Felix before upgrading the package. Regards, Gerrit.
Index: httpd.c =================================================================== RCS file: /cvs/httpd/httpd.c,v retrieving revision 1.85 diff -u -r1.85 httpd.c --- httpd.c 31 Jan 2005 16:10:39 -0000 1.85 +++ httpd.c 31 Jan 2005 23:01:34 -0000 @@ -1192,6 +1192,8 @@ } #endif buffer_flush(buffer_1); + sendfile(1,fd,&offset,rangeend-rangestart); + /* { off_t l=rangeend-rangestart; do { @@ -1201,6 +1203,7 @@ l-=c; } while (l); } + */ return 0; } #else