Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Oct 2002 10:52:58 -0700
From:      Alfred Perlstein <alfred@FreeBSD.org>
To:        Dag-Erling Smorgrav <des@ofug.org>
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>
In-Reply-To: <xzpy98tw2bz.fsf@flood.ping.uio.no>
References:  <200209202150.g8KLov9s006373@freefall.freebsd.org> <xzpy98tw2bz.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
* Dag-Erling Smorgrav <des@ofug.org> [021020 08:35] wrote:
> Alfred Perlstein <alfred@FreeBSD.org> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021020175258.GG91539>