From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bruce Stephens Newsgroups: gmane.emacs.devel Subject: Re: Emacs core TLS support Date: Mon, 27 Sep 2010 16:02:23 +0100 Message-ID: <80aan3grgg.fsf@tiny.isode.net> References: <878wc1vfh3.fsf@lifelogs.com> <87r5i2d00q.fsf@lifelogs.com> <87zkwqijye.fsf@stupidchicken.com> <878w4actmg.fsf@lifelogs.com> <877hju123h.fsf@stupidchicken.com> <8762yklrdk.fsf@lifelogs.com> <87wrqzhrjv.fsf@lifelogs.com> <87fwxmihyz.fsf@lifelogs.com> <8762ycfhqo.fsf@lifelogs.com> <87d3sf9soo.fsf@lifelogs.com> <87r5gh2fzj.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1285599766 5643 80.91.229.12 (27 Sep 2010 15:02:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 27 Sep 2010 15:02:46 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 27 17:02:45 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P0FE1-00039D-VX for ged-emacs-devel@m.gmane.org; Mon, 27 Sep 2010 17:02:42 +0200 Original-Received: from localhost ([127.0.0.1]:45309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0FE1-0007pl-P1 for ged-emacs-devel@m.gmane.org; Mon, 27 Sep 2010 11:02:41 -0400 Original-Received: from [140.186.70.92] (port=38450 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0FDt-0007ox-0B for emacs-devel@gnu.org; Mon, 27 Sep 2010 11:02:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0FDo-00027B-7Z for emacs-devel@gnu.org; Mon, 27 Sep 2010 11:02:32 -0400 Original-Received: from rufus.isode.com ([62.3.217.251]:50593) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0FDn-00026j-S1 for emacs-devel@gnu.org; Mon, 27 Sep 2010 11:02:28 -0400 Original-Received: from tiny.isode.net (shiny.isode.com [62.3.217.250]) by rufus.isode.com (submission channel) via TCP with ESMTPA id for ; Mon, 27 Sep 2010 16:02:23 +0100 Original-Received: by tiny.isode.net (sSMTP sendmail emulation); Mon, 27 Sep 2010 16:02:23 +0100 X-Hashcash: 1:20:100927:emacs-devel@gnu.org::iUpo6jKJCtliav6f:0000000000000000000000000000000000000000001lEa In-Reply-To: (Lars Magne Ingebrigtsen's message of "Mon, 27 Sep 2010 16:40:09 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:131001 Archived-At: Lars Magne Ingebrigtsen writes: [...] > However, it then loops taking 100% CPU, since _gnutls_read() is being > called in an infloop since the socket in non-blocking, or something... In case it's not handled correctly already, TLS is potentially confusing in that sometimes in order to read something it's necessary to write and vice versa (because TLS sends and receives things in packets that don't necessarily match the units of communication at other levels). So using non-blocking I/O in TLS requires some care; the conditions at the socket level you want to be triggered for don't necessarily match what you're trying to do at the higher level.