From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Asynchronous DNS Date: Mon, 01 Feb 2016 03:36:13 +0100 Organization: Programmerer Ingebrigtsen Message-ID: <87wpqpjgwy.fsf@gnus.org> References: <87si1gx6wz.fsf@gnus.org> <86y4b5zvzt.fsf@gmail.com> <8760y9kwrk.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1454294658 16267 80.91.229.3 (1 Feb 2016 02:44:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Feb 2016 02:44:18 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 01 03:44:03 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aQ4TC-00063C-8g for ged-emacs-devel@m.gmane.org; Mon, 01 Feb 2016 03:44:02 +0100 Original-Received: from localhost ([::1]:44217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQ4TB-0003aW-MR for ged-emacs-devel@m.gmane.org; Sun, 31 Jan 2016 21:44:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQ4M1-0005o0-4g for emacs-devel@gnu.org; Sun, 31 Jan 2016 21:36:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQ4Lx-0007xS-UW for emacs-devel@gnu.org; Sun, 31 Jan 2016 21:36:37 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:52610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQ4Lx-0007xH-Mc for emacs-devel@gnu.org; Sun, 31 Jan 2016 21:36:33 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aQ4Lv-0001G6-Aj for emacs-devel@gnu.org; Mon, 01 Feb 2016 03:36:31 +0100 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Feb 2016 03:36:31 +0100 Original-Received: from larsi by cpe-60-225-211-161.nsw.bigpond.net.au with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Feb 2016 03:36:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 31 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cpe-60-225-211-161.nsw.bigpond.net.au Mail-Copies-To: never User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:X0YBglyEYoadgrtyT+6Q0R09Uig= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:199105 Archived-At: Both GnuTLS and normal sockets now use asynchronous DNS resolution, if available. I've reworked how TLS connections are set up, too as a result, and I think the new version is a bit more logical. Previously you called make-network-socket, and then called gnutls-boot on that socket to "make it into" a TLS socket, which is a kinda low level of doing that stuff. You can still do that, but you can now also pass in the GnuTLS boot parameters with the new :tls-parameters keyword, and then make-network-socket will do everything for you. As far as I can tell, the code works both with and without getaddrinfo, getaddrinfo_a, TLS and nowait. That's quite a few combinations. :-) I've also skimmed the getaddrinfo_a source code, and it's kinda trivial. Perhaps it would be a good idea to just replace the getaddrinfo_a stuff with our own little async DNS library. Basically all it does is start a new thread that does getaddrinfo, and then stashes the response somewhere. The library supports doing more than that (async callbacks etc), but we don't need all that stuff. So perhaps it makes more sense just to implement this ourselves, and then it would also work on non-glibc systems... (We'd need to support gethostbyname, too, of course.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no