emacs-devel
[Top][All Lists]
Advanced

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

Re: gnutls infloop possibly fixed


From: Lars Ingebrigtsen
Subject: Re: gnutls infloop possibly fixed
Date: Mon, 13 Feb 2012 20:39:46 +0100
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux)

I had a bug report of a strange file-error "success" being reported by a
Gnus user, and I applied the following patch.  It sets errno to EAGAIN
if GnuTLS returns EAGAIN.

Does this make sense, or is it just cargo-cult programming?

=== modified file 'src/gnutls.c'
*** src/gnutls.c        2012-02-11 17:06:14 +0000
--- src/gnutls.c        2012-02-13 19:35:30 +0000
***************
*** 365,372 ****
        {
          if (rtnval == GNUTLS_E_INTERRUPTED)
            continue;
!         else
            break;
        }
  
        buf += rtnval;
--- 365,384 ----
        {
          if (rtnval == GNUTLS_E_INTERRUPTED)
            continue;
!         else {
!           /* If we get EAGAIN, then set errno appropriately so that
!              send_process retries the correct way instead of
!              erroring out. */
!           if (rtnval == EAGAIN) {
! #ifdef EWOULDBLOCK
!             errno = EWOULDBLOCK;
! #endif
! #ifdef EAGAIN
!             errno = EAGAIN;
! #endif
!           }
            break;
+         }
        }
  
        buf += rtnval;


-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Rome




reply via email to

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