emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs on windows and GnuTLS


From: Fabrice Popineau
Subject: Re: Emacs on windows and GnuTLS
Date: Sun, 3 Nov 2013 17:16:34 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Ted Zlatanov <tzz <at> 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
>  <at>  <at>  -487,9 +487,13  <at>  <at> 
>      }
>    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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]