From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22493: 25.1.50; open-gnutls-stream doesn't respect :nowait, so the connections are synchronous Date: Sun, 31 Jan 2016 17:59:49 +0200 Message-ID: <8360y93fka.fsf@gnu.org> References: <87mvrnzpge.fsf@gnus.org> <878u37zndq.fsf@gnus.org> <83r3gzwhg8.fsf@gnu.org> <87fuxebrsy.fsf@gnus.org> <878u36fung.fsf@gnus.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1454256087 10830 80.91.229.3 (31 Jan 2016 16:01:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Jan 2016 16:01:27 +0000 (UTC) Cc: 22493@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 31 17:01:16 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 1aPuR9-0007nd-8J for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Jan 2016 17:01:15 +0100 Original-Received: from localhost ([::1]:42151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPuR5-0008DO-KG for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Jan 2016 11:01:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPuR0-0008DJ-Rk for bug-gnu-emacs@gnu.org; Sun, 31 Jan 2016 11:01:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPuQw-0005Gi-AI for bug-gnu-emacs@gnu.org; Sun, 31 Jan 2016 11:01:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPuQw-0005Ge-6e for bug-gnu-emacs@gnu.org; Sun, 31 Jan 2016 11:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aPuQw-0004Mm-0W for bug-gnu-emacs@gnu.org; Sun, 31 Jan 2016 11:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Jan 2016 16:01:01 +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.145425602916732 (code B ref 22493); Sun, 31 Jan 2016 16:01:01 +0000 Original-Received: (at 22493) by debbugs.gnu.org; 31 Jan 2016 16:00:29 +0000 Original-Received: from localhost ([127.0.0.1]:43282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aPuQO-0004Lo-O2 for submit@debbugs.gnu.org; Sun, 31 Jan 2016 11:00:28 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35021) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aPuQM-0004Lc-VU for 22493@debbugs.gnu.org; Sun, 31 Jan 2016 11:00:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPuQD-0005By-GM for 22493@debbugs.gnu.org; Sun, 31 Jan 2016 11:00:21 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPuQD-0005Bu-Co; Sun, 31 Jan 2016 11:00:17 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3578 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aPuQB-0000r8-8q; Sun, 31 Jan 2016 11:00:17 -0500 In-reply-to: <878u36fung.fsf@gnus.org> (message from Lars Ingebrigtsen on Sun, 31 Jan 2016 01:40:51 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:112135 Archived-At: > From: Lars Ingebrigtsen > Date: Sun, 31 Jan 2016 01:40:51 +0100 > > I have now implemented this, but in a slightly different way. I > introduced a new process slot to say that we shouldn't be writing yet. > > However, the Lisp part of the implementation is not very satisfactory. > This is basically it: > > (let ((process (open-network-stream name buffer host service > :nowait nowait))) > (if nowait > (progn > (gnutls-mark-process process t) > (set-process-sentinel process 'gnutls-async-sentinel) > process) > (gnutls-negotiate :process (open-network-stream name buffer host service) > :type 'gnutls-x509pki > :hostname host)))) > ... > > (defun gnutls-async-sentinel (process change) > (when (string-match "open" change) > (gnutls-negotiate :process process > :type 'gnutls-x509pki > :hostname (car (process-contact process))) > (gnutls-mark-process process nil))) > > > The problem here is that this library is now putting a sentinel on the > process. But any callers that want an asynchronous connection will also > be setting sentinels on the same process, which means that the > connection sentinel will be overwritten. > > I've kludged this together in one of the callers (in url-http.el), but > that's too ugly to live. (It checks for a sentinel and daisy-chains the > previous one. Eek.) > > So that has to be rewritten. But I'm not sure how... We, like, have > several layers of possible sentinels here, and... uhm... Ahmm... maybe it would have been better to wait until the discussion completes and reaches some solid conclusions? > Ideas? Like I wrote elsewhere, I don't understand what this gives us. The sentinel runs in the main thread, so you still wait for the GnuTLS handshake to complete. Right?