Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10111 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88850 invoked by uid 1010); 27 May 2004 13:22:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88558 invoked from network); 27 May 2004 13:22:20 -0000 Received: from unknown (HELO xaxa.search.ch) (195.141.85.117) by pb1.pair.com with SMTP; 27 May 2004 13:22:20 -0000 Received: from localhost (localhost [127.0.0.1]) by xaxa.search.ch (Postfix) with ESMTP id 090A86D866; Thu, 27 May 2004 15:22:20 +0200 (CEST) Received: by xaxa.search.ch (Postfix, from userid 65534) id D33806D868; Thu, 27 May 2004 15:22:18 +0200 (CEST) Received: from cschneid.com (ultrafilter-i [192.168.85.2]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by xaxa.search.ch (Postfix) with ESMTP id 43E2D6D866; Thu, 27 May 2004 15:22:18 +0200 (CEST) Message-ID: <40B5EB89.3090709@cschneid.com> Date: Thu, 27 May 2004 15:22:17 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114 X-Accept-Language: en-us, en, de-ch MIME-Version: 1.0 To: Wez Furlong Cc: internals@lists.php.net References: <20040527123831.61330.qmail@pb1.pair.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on xaxa.search.ch X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.63 X-Virus-Scanned: by AMaViS 0.3.12pre8 Subject: Re: [PHP-DEV] feof hangs (bug #25939) From: cschneid@cschneid.com (Christian Schneider) Wez Furlong wrote: > I have to go out for a couple of hours; if you could track down where PHP is > blocking in the 4.3 branch, I'd very much appreciate it. It hangs in main/network.c the change introduced from 1.83.2.20 to 1.83.2.21 in the select shown here if no data can be read (yet). This doesn't mean that we encountered an eof though. (Another small nitpick is that tv.tv_usec is not initialized if default_socket_timeout is used). main/network.c: @@ -1139,9 +1139,15 @@ int alive = 1; int fd = sock->socket; fd_set rfds; - struct timeval tv = {0, 0}; + struct timeval tv; char buf; + if (sock->timeout.tv_sec == -1) { + tv.tv_sec = FG(default_socket_timeout); + } else { + tv = sock->timeout; + } + /* logic: if the select call indicates that there is data to * be read, but a read returns 0 bytes of data, then the socket * has been closed. */ FD_ZERO(&rfds); FD_SET(fd, &rfds); if (select(fd+1, &rfds, NULL, NULL, &tv) > 0) {