GNU bug report logs -
#34341
26.1; url-retrieve-synchronously returns blank buffer
Previous Next
Reported by: Laurent Charignon <l.charignon <at> gmail.com>
Date: Wed, 6 Feb 2019 07:11:01 UTC
Severity: normal
Tags: fixed
Merged with 39158
Found in version 26.1
Fixed in versions 26.3, 27.1
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Robert Pluim <rpluim <at> gmail.com>
>> Date: Mon, 06 May 2019 14:15:27 +0200
>> Cc: Laurent Charignon <l.charignon <at> gmail.com>, 34341 <at> debbugs.gnu.org
>>
>> >>>>> On Mon, 06 May 2019 08:10:32 -0400, Noam Postavsky <npostavs <at> gmail.com> said:
>>
>> Noam> Thanks, I wasn't aware of this, I'll check if that helps
>> Noam> later today. I think it makes sense to backport regardless
>> Noam> though.
I can confirm that
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
avoids the problem on my Arch box (has gnutls v3.6.7).
>> I do too, but last time Eli wasn't too enthusiastic about it.
>
> It's a complex change, and we don't even know whether emacs-26 will be
> used for another "regular" release. What if we need it for some
> emergency release, for example? Having to remember there was this
> cherry-pick, and branching from before it, reverting it, is not my
> idea of fun.
I found this smaller change fixes it also. Is it simple enough to for
emacs-26? Otherwise, we should set gnutls-algorithm-priority because
(as far as I understand) we have a broken TLS1.3 implementation at the
momement.
[0001-Handle-GNUTLS_E_AGAIN-in-emacs_gnutls_read-Bug-34341.patch (text/x-diff, inline)]
From 6d5f5670443f7adfbd6993173ad997ce25827775 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Mon, 6 May 2019 19:55:17 -0400
Subject: [PATCH] Handle GNUTLS_E_AGAIN in emacs_gnutls_read (Bug#34341)
* src/gnutls.c (emacs_gnutls_read): Similar to emacs_gnutls_write,
when gnutls_record_recv returns GNUTLS_E_AGAIN set errno to EGAIN.
---
src/gnutls.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/gnutls.c b/src/gnutls.c
index 3c16b6c9c3..b724c3592d 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -753,8 +753,15 @@ emacs_gnutls_read (struct Lisp_Process *proc, char *buf, ptrdiff_t nbyte)
/* The peer closed the connection. */
return 0;
else if (emacs_gnutls_handle_error (state, rtnval))
- /* non-fatal error */
- return -1;
+ {
+ /* If we get GNUTLS_E_AGAIN, then set errno appropriately so that
+ wait_reading_process_output retries the correct way instead of
+ erroring out. */
+ if (rtnval == GNUTLS_E_AGAIN)
+ errno = EAGAIN;
+ /* non-fatal error */
+ return -1;
+ }
else {
/* a fatal error occurred */
return 0;
--
2.11.0
This bug report was last modified 4 years and 193 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.