From owner-freebsd-bugs Wed Aug 16 3:14:17 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from onion.ish.org (onion.ish.org [210.145.219.202]) by hub.freebsd.org (Postfix) with ESMTP id E0B5737BBAC for ; Wed, 16 Aug 2000 03:14:11 -0700 (PDT) (envelope-from ishizuka@ish.org) Received: from localhost (ishizuka@localhost [127.0.0.1]) by onion.ish.org (8.9.3/3.7Wpl2-2000/05/28) with ESMTP id TAA03140 for ; Wed, 16 Aug 2000 19:14:09 +0900 (JST) To: freebsd-bugs@freebsd.org Subject: Re: bin/20613: fetch -T n is not timeout correctly In-Reply-To: <200008151650.JAA67910@freefall.freebsd.org> References: <200008151650.JAA67910@freefall.freebsd.org> X-Mailer: Mew version 1.94.2 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) X-PGP-Fingerprint20: 276D 697A C2CB 1580 C683 8F18 DA98 1A4A 50D2 C4CB X-PGP-Fingerprint16: C6 DE 46 24 D7 9F 22 EB 79 E2 90 AB 1B 9A 35 2E X-PGP-Public-Key: http://www.ish.org/pgp-public-key.txt X-URL: http://www.ish.org/ Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20000816191409C.ishizuka@onion.ish.org> Date: Wed, 16 Aug 2000 19:14:09 +0900 From: Masachika ISHIZUKA X-Dispatcher: imput version 20000414(IM141) Lines: 31 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >> % 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. > > This reminded me of an old problem with ping(8). ^C doesn't work for > killing ping when DNS lookup hangs, provided you wait a second or two > for execution to reach res_send(). This is because res_send() retries > after EINTR, so it doesn't work with signal handlers that just set a > flag. ping's SIGINT handler was fixed a few years ago to just set a > flag (previously it called stdio functions). > > The problem in fetch(1) seems to be the same. fetch's SIGINT and > SIGALRM handlers just set a flag, so neither -T nor ^C can be used to > kill fetch when DNS lookup hangs. > > ping's SIGALRM handler also just sets a flag, but this works right > because ping only uses alarms to control syscalls and EINTR works > right for syscalls. Hi, Thank you for mail. And more, even when DNS lookup is not done, % fetch -T 5 http://10.1.2.3/ttt.txt is timeout after 75 seconds. (I assume that there are no hosts with 10.1.2.3 in your LANs.) -- ishizuka@ish.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message