Re: Re: Critical bugs to fix before ANY release

From: Date: Mon, 08 Sep 2008 14:39:48 +0000
Subject: Re: Re: Critical bugs to fix before ANY release
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-40345@lists.php.net to get a copy of this message
On Mon, Sep 8, 2008 at 5:30 PM, Christian Schneider <cschneid@cschneid.com> wrote: > I had a quick look at bug > http://bugs.php.net/bug.php?id=45928 > and found the problem to be in Zend/zend_stream.c function > zend_stream_fsize(): It uses fstat() to determine the filesize which on > MacOS X for pipes returns either 0 (my interpretation: no data from the > pipe ready yet) or a number up to 16384 (my interpretation: data from > the pipe ready but the maximum buffer size is 16k). I believe your interpretation is correct. it returns amount of data, which is available on pipe, so we can request that amount immediately, and later check if some more is available. > I see several solutions but I'm not sure which is the desired one: > - return 0 (size unknown) if the file is a pipe (or socket, ...) > - return 0 if the file is not a regular file (or symlink, dir?) > - look into a way of determining EOF reached well, I guess there is no way to get "filesize" of piped data, because it is completely dynamic. at the lowest level, libc's read() returns 0 in case of EOF and -1 in case of error. that's the way to distinguish them. -- Alexey Zakhlestin http://blog.milkfarmsoft.com/

« previous php.internals (#40345) next »