Re: [PHP-DEV] readfile() improvements

2004-06-09 Thread Alexander Valyalkin
On Tue, 08 Jun 2004 12:51:33 +0200, Morten K. Poulsen <[EMAIL PROTECTED]> wrote: On Tue, 2004-06-08 at 11:32, Alexander Valyalkin wrote: +/* get the length of local file connected to descriptor fd */ fstat(fd, &sbuf); [snip] +if (errno) { Oh-oh! You need to check the ret

Re: [PHP-DEV] readfile() improvements

2004-06-08 Thread Morten K. Poulsen
On Tue, 2004-06-08 at 11:32, Alexander Valyalkin wrote: > +/* get the length of local file connected to descriptor fd */ > fstat(fd, &sbuf); [snip] > +if (errno) { Oh-oh! You need to check the return value of fstat(). Errno is only set if fstat() fails (returns -1), otherw

Re: [PHP-DEV] readfile() improvements

2004-06-08 Thread Alexander Valyalkin
On Mon, 7 Jun 2004 20:02:54 +0400, Antony Dovgal <[EMAIL PROTECTED]> wrote: On Mon, 07 Jun 2004 18:55:52 +0300 "Alexander Valyalkin" <[EMAIL PROTECTED]> wrote: On Mon, 07 Jun 2004 17:07:06 +0300, Andi Gutmans <[EMAIL PROTECTED]> wrote: > Can you send a unified diff? > `cvs diff -u`, plz or `diff

Re: [PHP-DEV] readfile() improvements

2004-06-07 Thread Antony Dovgal
On Mon, 07 Jun 2004 18:55:52 +0300 "Alexander Valyalkin" <[EMAIL PROTECTED]> wrote: > On Mon, 07 Jun 2004 17:07:06 +0300, Andi Gutmans <[EMAIL PROTECTED]> > wrote: > > > Can you send a unified diff? > > `cvs diff -u`, plz or `diff -u` --- WBR, Antony Dovgal aka tony2001 [EMAIL PROTECTED] || [EM

Re: [PHP-DEV] readfile() improvements

2004-06-07 Thread Alexander Valyalkin
On Mon, 07 Jun 2004 17:07:06 +0300, Andi Gutmans <[EMAIL PROTECTED]> wrote: Can you send a unified diff? ==cut= 1065,1066c1065,1066 < size_t bcount = 0; < int ready = 0; --- size_t bcount = 0; /* counter of printed out bytes */ int is_mapped = 0; 1067a106

Re: [PHP-DEV] readfile() improvements

2004-06-07 Thread Alexander Valyalkin
On Mon, 7 Jun 2004 10:19:09 -0400, Ilia Alshanetsky <[EMAIL PROTECTED]> wrote: IMO Adding additional error reporting is a good idea, but we should keep MAP_SHARED as the mmap mode. In Apache environment if the file is mapped by more then one process the memory needed to map the file is shared,

Re: [PHP-DEV] readfile() improvements

2004-06-07 Thread Alexander Valyalkin
On Mon, 07 Jun 2004 17:07:06 +0300, Andi Gutmans <[EMAIL PROTECTED]> wrote: Can you send a unified diff? At 02:08 PM 6/7/2004 +0300, Alexander Valyalkin wrote: No, because I dont know how create it :) Please, explain how can I create unified diff under windows. I'm newbie in PHP source development,

Re: [PHP-DEV] readfile() improvements

2004-06-07 Thread Ilia Alshanetsky
IMO Adding additional error reporting is a good idea, but we should keep MAP_SHARED as the mmap mode. In Apache environment if the file is mapped by more then one process the memory needed to map the file is shared, rather then each fork allocating it's own copy. Unless we decide to make this a

Re: [PHP-DEV] readfile() improvements

2004-06-07 Thread Andi Gutmans
Can you send a unified diff? At 02:08 PM 6/7/2004 +0300, Alexander Valyalkin wrote: When I try to print huge files (greate than 500Mb) using readfile() function, my computer crashes. Why? I found in the PHP 4.3.7 sources the file /main/strems.c and function _php_stream_passthru() in it. The readfil