Article View: news.software.nntp
Article #78650Re: Regarding INN - name to address resolution for peers
From: Russ Allbery
Date: Tue, 05 Feb 2008 23:22
Date: Tue, 05 Feb 2008 23:22
38 lines
3105 bytes
3105 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:
> HOWEVER, in "cxnConnect()", we don't seem to rotate through the
> addresses where there is a "can't create socket" or a "can't set socket
> non-blocking" error by calling "hostIpFailed(cxn->myHost)" and I think
> we need to - else we repeatedly try the same AF+address that failed the
> last time - in a virtual infinite loop if it never succeeds (such as
> trying an IPv6 address returned by the resolver on an IPv4-only kerneled
> host).
You're right, this code should use a non-blocking version of
network_connect rather than reinventing the wheel. network_connect does
the right thing with failure to create sockets for a particular AF.
I could have sworn I already wrote a non-blocking network_connect based on
this code for some other project, but perhaps not.
> I don't know if we need the "hostIpFailed()" call in the "newEndPoint"
> conditional (about line 552) of "cxnConnect()" also, but I would suspect
> so.
I doubt it. Look at what newEndPoint does. It's not related to the
remote address.
> My suggestion: Add a "hostIpFailed(cxn->myHost);" statement to the
> "then" clauses of the conditionals at lines 519, 529, and 552 of
> "innfeed/connection.c". The conditional at line 541 already has it in
> its "then" clause.
I agree only with line 519 (the failure to create the socket). I've made
that change in CURRENT. It doesn't make sense to me to do this for local
failures such as setting a socket non-blocking.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID:
<87lk5zrntp.fsf@windlord.stanford.edu>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!headwall.stanford.edu!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mailReferences:
<fnqsnb$e8h$1@snarked.org> <fo82tr$14d$1@bongo.bofh.it> <fo8pcb$nkd$1@snarked.org> <87ejbs0ytv.fsf@windlord.stanford.edu> <fo8uhn$o2q$1@snarked.org> <87odavzzlq.fsf@windlord.stanford.edu> <fo93cm$oik$1@snarked.org> <87prvbyhy9.fsf@windlord.stanford.edu> <fo969n$qhl$1@snarked.org> <87fxw71bi4.fsf@windlord.stanford.edu> <foaqf4$jnr$1@snarked.org>Show Full Headers
Complete Article Headers
Message-ID: <87lk5zrntp.fsf@windlord.stanford.edu> Subject: Re: Regarding INN - name to address resolution for peers Date: Tue, 05 Feb 2008 15:22:10 -0800 From: Russ Allbery <rra@stanford.edu> References: <fnqsnb$e8h$1@snarked.org> <fo82tr$14d$1@bongo.bofh.it> <fo8pcb$nkd$1@snarked.org> <87ejbs0ytv.fsf@windlord.stanford.edu> <fo8uhn$o2q$1@snarked.org> <87odavzzlq.fsf@windlord.stanford.edu> <fo93cm$oik$1@snarked.org> <87prvbyhy9.fsf@windlord.stanford.edu> <fo969n$qhl$1@snarked.org> <87fxw71bi4.fsf@windlord.stanford.edu> <foaqf4$jnr$1@snarked.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!headwall.stanford.edu!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail Newsgroups: news.software.nntp Organization: The Eyrie Lines: 38 NNTP-Posting-Host: windlord.stanford.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.Stanford.EDU 1202253730 21493 171.64.19.147 (5 Feb 2008 23:22:10 GMT) X-Complaints-To: news@news.stanford.edu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:ZAtabwNLjUFZAsspZ754P0zBAzY=