Bug 158125 - [patch] whois(1) takes too long to move to next address.
Summary: [patch] whois(1) takes too long to move to next address.
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 8.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-21 15:20 UTC by marka
Modified: 2015-05-18 21:28 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (3.36 KB, patch)
2011-06-21 15:20 UTC, marka
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description marka 2011-06-21 15:20:09 UTC
	whois has a simple connect loop which has doesn't fallback to
	alternate address on connect failures in a timely manner.

Fix: Attempt to connect to alternate addresses if the connect
	doesn't succeed in 100ms.  Take the first connection to
	succeed and close the others.  Reduce the wait between
	connection attempts by 2 on each connection attempt.
How-To-Repeat: 
	block connections to whois.ripe.net over IPv6 then try to
	lookup information in ripe's whois database from a dual
	stack server.
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-04-25 00:52:21 UTC
A commit references this bug:

Author: delphij
Date: Sat Apr 25 00:51:45 UTC 2015
New revision: 281959
URL: https://svnweb.freebsd.org/changeset/base/281959

Log:
  Try alternate addresses more agressively.

  Attempt to connect to alternate addresses if the connect doesn't
  succeed in 180ms, and cut wait time between connection attempts
  in half for each additional, if no connection was established.

  Take the first connection to succeed and close the others.

  This makes whois more responsive when e.g. IPv6 service took long
  time or fail to respond.

  PR:		158125
  Submitted by:	Mark Andrews <marka isc org> (with changes from me)
  MFC after:	2 weeks

Changes:
  head/usr.bin/whois/whois.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-05-18 21:27:59 UTC
A commit references this bug:

Author: delphij
Date: Mon May 18 21:27:47 UTC 2015
New revision: 283083
URL: https://svnweb.freebsd.org/changeset/base/283083

Log:
  MFC r281959,282885 (fanf, partial),282888 (fanf):

  Try alternate addresses more agressively.

  PR:             158125
  Submitted by:   Mark Andrews <marka isc org> (with changes from me)

  whois: code cleanup

  Use pedantically correct types.

  whois: do not clobber command-line flags when tweaking O_NONBLOCK

  This can make whois fail to follow referrals when it should.
  The bug was introduced in r281959.

Changes:
_U  stable/10/
  stable/10/usr.bin/whois/whois.c
Comment 3 Xin LI freebsd_committer freebsd_triage 2015-05-18 21:28:42 UTC
Patch applied against stable/10.  Thanks for your submission!