From owner-cvs-all Sun Oct 20 10:52:59 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B7AA37B401; Sun, 20 Oct 2002 10:52:58 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 500AE43E88; Sun, 20 Oct 2002 10:52:58 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 249EEAE23A; Sun, 20 Oct 2002 10:52:58 -0700 (PDT) Date: Sun, 20 Oct 2002 10:52:58 -0700 From: Alfred Perlstein To: Dag-Erling Smorgrav Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libfetch common.c Message-ID: <20021020175258.GG91539@elvis.mu.org> References: <200209202150.g8KLov9s006373@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Dag-Erling Smorgrav [021020 08:35] wrote: > Alfred Perlstein writes: > > Log: > > Fix an infinite loop when _fetch_read() can return 0 (if the > > connection is broken), take this into account and return at this > > point. > > This probably fixes the wrong bug: _fetch_read() shouldn't return 0. > It currently does if it times out before reading anything (but not, as > you say, if the connection is broken); it should return -1 instead, > and your change to _fetch_getln() should be reverted. If the connection is broken then it returns 0, this was the whole source of the bug. The read(2) call in fetch_read returns 0 on EOF/broken connection. -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message