From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#22493: 25.1.50; open-gnutls-stream doesn't respect :nowait, so the connections are synchronous Date: Tue, 02 Feb 2016 02:43:02 +0100 Message-ID: <87bn7znazd.fsf@gnus.org> References: <87mvrnzpge.fsf@gnus.org> <878u37zndq.fsf@gnus.org> <83r3gzwhg8.fsf@gnu.org> <87fuxebrsy.fsf@gnus.org> <878u36fung.fsf@gnus.org> <8360y93fka.fsf@gnu.org> <87wpqpwd8p.fsf@gnus.org> <83d1sh14is.fsf@gnu.org> <87egcx13kc.fsf@gnus.org> <83bn801d06.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1454377464 29917 80.91.229.3 (2 Feb 2016 01:44:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Feb 2016 01:44:24 +0000 (UTC) Cc: 22493@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 02 02:44:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1aQQ0p-0004lL-R1 for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Feb 2016 02:44:12 +0100 Original-Received: from localhost ([::1]:54736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQQ0o-0005FL-Sl for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Feb 2016 20:44:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQQ0l-0005F1-K1 for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2016 20:44:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQQ0g-00073f-KW for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2016 20:44:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46908) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQQ0g-00073b-Gm for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2016 20:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aQQ0g-0003gi-C7 for bug-gnu-emacs@gnu.org; Mon, 01 Feb 2016 20:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Feb 2016 01:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22493 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22493-submit@debbugs.gnu.org id=B22493.145437741114130 (code B ref 22493); Tue, 02 Feb 2016 01:44:02 +0000 Original-Received: (at 22493) by debbugs.gnu.org; 2 Feb 2016 01:43:31 +0000 Original-Received: from localhost ([127.0.0.1]:55497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aQQ0B-0003fq-HF for submit@debbugs.gnu.org; Mon, 01 Feb 2016 20:43:31 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:43520) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aQQ0A-0003fi-AS for 22493@debbugs.gnu.org; Mon, 01 Feb 2016 20:43:30 -0500 Original-Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aQPzn-0008Qf-MQ; Tue, 02 Feb 2016 02:43:08 +0100 In-Reply-To: <83bn801d06.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 Feb 2016 20:50:17 +0200") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aQPzn-0008Qf-MQ MailScanner-NULL-Check: 1454982188.43426@giWHTyaLbTO4S+MpvfR3KQ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112244 Archived-At: Eli Zaretskii writes: > A sentinel indeed starts when Emacs is idle, but once it kicks in, it > runs to completion, and Emacs cannot do anything else while it does. > So if the user presses a key a millisecond after the sentinel is > invoked and starts the GnuTLS negotiation procedure, the user will > still have to wait. Sure. But the wait is much shorter. Anyway, the next step is, of course, to make the GnuTLS negotiation asynchronous, too, so that the entire thing is unnoticeable. The library itself is async, but it block because emacs_gnutls_handshake does this: do { ret = gnutls_handshake (state); emacs_gnutls_handle_error (state, ret); QUIT; } while (ret < 0 && gnutls_error_is_fatal (ret) == 0); Loop until the handshake completes. The function should instead mark the process' status as 'tls-handshake, return and continue the handshake from the idle loop. Which is something I'm not going to do straight away, because the changes already in are complex enough. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no