Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40345 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93900 invoked from network); 8 Sep 2008 14:39:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2008 14:39:52 -0000 Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.14 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 209.85.217.14 mail-gx0-f14.google.com Received: from [209.85.217.14] ([209.85.217.14:57244] helo=mail-gx0-f14.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/3C-58883-73935C84 for ; Mon, 08 Sep 2008 10:39:51 -0400 Received: by gxk7 with SMTP id 7so7965303gxk.23 for ; Mon, 08 Sep 2008 07:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=m5twwE0QlgvBgC9k7Vr+duVuW9O6hhTXXZjrznSp5sc=; b=s/R8YMVRpynvoPEkQwIH/Fzsuhz3/6J+Ka0Ytq2GxUm7paZmkiKLzYZDtFBaVxJkNT +QBGSwGAGLErdBM1/K/FmPtV5X14TkWujEBaO5rb9wUcqcq5qy6rMLg7RcDoU6zcnjRr qjLZBbBiPOsj2LkoFrPS/Qn+mlPxX3F/JOJ6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=oEPEx0sfRLXv2WYcxFugpZqrvXizQLDBUUqCRKUy1PKq6j70ZS9B7WnOpSz7sRpY7D zYvuVd+pBeGjK7qpX1SIp0D9EzefvGiBcywxaVBKeoRQhGNBhXPbIeHW8wTUlukTRpGf 7ENdGNooURgyuLPcLNTVgActAFJvzbIInArkM= Received: by 10.150.133.18 with SMTP id g18mr21454435ybd.137.1220884788626; Mon, 08 Sep 2008 07:39:48 -0700 (PDT) Received: by 10.150.186.11 with HTTP; Mon, 8 Sep 2008 07:39:48 -0700 (PDT) Message-ID: Date: Mon, 8 Sep 2008 18:39:48 +0400 To: "Christian Schneider" Cc: jani.taskinen@iki.fi, "internals Mailing List" In-Reply-To: <48C528D9.3030608@cschneid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48C3BC03.7060004@sci.fi> <48C528D9.3030608@cschneid.com> Subject: Re: [PHP-DEV] Re: Critical bugs to fix before ANY release From: indeyets@gmail.com ("Alexey Zakhlestin") On Mon, Sep 8, 2008 at 5:30 PM, Christian Schneider 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/