From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fabrice Popineau Newsgroups: gmane.emacs.devel Subject: Re: Emacs on windows and GnuTLS Date: Sun, 3 Nov 2013 17:16:34 +0000 (UTC) Message-ID: References: <877gcpu3bu.fsf@flea.lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1383499031 24291 80.91.229.3 (3 Nov 2013 17:17:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Nov 2013 17:17:11 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 03 18:17:13 2013 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 1Vd1IV-0002Sm-3v for ged-emacs-devel@m.gmane.org; Sun, 03 Nov 2013 18:17:11 +0100 Original-Received: from localhost ([::1]:45859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vd1IU-0004jM-LN for ged-emacs-devel@m.gmane.org; Sun, 03 Nov 2013 12:17:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vd1IM-0004iz-Aa for emacs-devel@gnu.org; Sun, 03 Nov 2013 12:17:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vd1IG-0006a7-Ff for emacs-devel@gnu.org; Sun, 03 Nov 2013 12:17:02 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:36589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vd1IG-0006a3-8r for emacs-devel@gnu.org; Sun, 03 Nov 2013 12:16:56 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Vd1IE-0002JH-U1 for emacs-devel@gnu.org; Sun, 03 Nov 2013 18:16:55 +0100 Original-Received: from abo-143-221-68.trs.modulonet.fr ([85.68.221.143]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 03 Nov 2013 18:16:54 +0100 Original-Received: from fabrice.popineau by abo-143-221-68.trs.modulonet.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 03 Nov 2013 18:16:54 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 86 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 85.68.221.143 (Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36) 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:164901 Archived-At: Ted Zlatanov lifelogs.com> writes: > > The ASERTs are coming from GnuTLS itself. You'll have to raise the > `gnutls-log-level' to 1 or 0. The non-fatal retries are probably > network-related. We don't have a way, IIRC, to tell the error's > severity in advance so we always issue it at level 1. But I have a note > in gnutls.c: > > GNUTLS_LOG2 (1, max_log_level, "non-fatal error:", str); > /* TODO: EAGAIN AKA Qgnutls_e_again should be level 2. */ > > so specifically for GNUTLS_EAGAIN we can go up to level 3. Could you > try that change on your own? See below for suggested patch. I will > install if it works for you. > > FP> I'm not sure it is even harmful. > FP> Any idea what could be wrong there ? > > Not harmful, just annoying :) > > Ted > > === modified file 'src/gnutls.c' > --- src/gnutls.c 2013-10-17 06:42:21 +0000 > +++ src/gnutls.c 2013-11-03 11:31:16 +0000 > -487,9 +487,13 > } > else > { > + bool eagain = (err == GNUTLS_E_AGAIN); > + int level = eagain ? 1 : 3; > ret = 1; > - GNUTLS_LOG2 (1, max_log_level, "non-fatal error:", str); > - /* TODO: EAGAIN AKA Qgnutls_e_again should be level 2. */ > + GNUTLS_LOG2 (level, > + max_log_level, > + eagain ? "retry:" : "non-fatal error:", > + str); > } > > if (err == GNUTLS_E_WARNING_ALERT_RECEIVED > > Thanks for the reply and the patch. >From what I have tested, I can make the following comments: - if I understand correctly, you want to put EAGAIN at level 3, so you need to : int level = eagain ? 3 : 1; - GNUTLS_LOG2 is a macro in which string concatenation is used for the third argument, so you can't put a ? : instruction there. So this gives me the following: @@ -463,9 +487,19 @@ } else { + bool eagain = (err == GNUTLS_E_AGAIN); + int level = eagain ? 3 : 1; ret = 1; - GNUTLS_LOG2 (1, max_log_level, "non-fatal error:", str); - /* TODO: EAGAIN AKA Qgnutls_e_again should be level 2. */ + if (eagain) + GNUTLS_LOG2 (level, + max_log_level, + "retry:", + str); + else + GNUTLS_LOG2 (level, + max_log_level, + "non-fatal error:", + str); } if (err == GNUTLS_E_WARNING_ALERT_RECEIVED And now the warning is not issued at level 1. Best regards, Fabrice