Date: Fri, 18 Aug 2000 02:06:48 +0900 From: Masachika ISHIZUKA <ishizuka@ish.org> To: ume@mahoroba.org Cc: FreeBSD-bugs@freebsd.org Subject: Re: bin/20613: fetch -T n is not timeout correctly Message-ID: <20000818020648U.ishizuka@onion.ish.org> In-Reply-To: <20000817.025250.74742437.ume@mahoroba.org> References: <20000817.025250.74742437.ume@mahoroba.org>
next in thread | previous in thread | raw e-mail | index | archive | help
>>>Description: >> >> % fetch -T 5 http://www.hoge.com/index.html >> >> When server 'www.hoge.com' is down or can't lookup address from >> DNS server, fetch command is not timeout with 5 seconds. >> Older version of fetch (with 4.0R or 3.4R) is timeout with 5 seconds. > > I cannot realize this problem with accessing > http://www.hoge.com/index.html. However, I heared from you that > fetching to the server where is actually not exist something like > "fetch -T 1 http://10.1.1.1/aaa.txt" causes this problem. > Is this patch fix your problem? > > Index: lib/libfetch/common.c > diff -u lib/libfetch/common.c.orig lib/libfetch/common.c > --- lib/libfetch/common.c.orig Tue Jul 18 07:01:26 2000 > +++ lib/libfetch/common.c Thu Aug 17 02:36:42 2000 > @@ -201,7 +201,12 @@ > if ((sd = socket(res->ai_family, res->ai_socktype, > res->ai_protocol)) == -1) > continue; > - if (connect(sd, res->ai_addr, res->ai_addrlen) != -1) > + if (fetchTimeout) > + alarm(fetchTimeout); > + err = connect(sd, res->ai_addr, res->ai_addrlen); > + if (fetchTimeout) > + alarm(0); > + if (err != -1) > break; > close(sd); > sd = -1; Hi, this is ishizuka. Thank you very much. This patch fixed my problem. And, sorry to say that I wrote 'www.hoge.com' to mean 'some.nonexist.domain.or.server' but this domain and this server really exists. -- ishizuka@ish.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000818020648U.ishizuka>