all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: emacs-devel@gnu.org
Subject: Re: gnutls infloop possibly fixed
Date: Mon, 13 Feb 2012 20:39:46 +0100	[thread overview]
Message-ID: <87pqdiwmil.fsf@gnus.org> (raw)
In-Reply-To: 8762fawntj.fsf@gnus.org

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	other threads:[~2012-02-13 19:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-11 17:10 gnutls infloop possibly fixed Lars Ingebrigtsen
2012-02-12  2:48 ` Ted Zlatanov
2012-02-12 19:47   ` Lars Ingebrigtsen
2012-02-12 21:34     ` Ted Zlatanov
2012-02-13 15:48     ` Tom Tromey
2012-02-13 19:11       ` Lars Ingebrigtsen
2012-02-13 19:39         ` Lars Ingebrigtsen [this message]
2012-02-13 20:46           ` Andreas Schwab
2012-02-13 20:47             ` Lars Ingebrigtsen
2012-02-13 21:41     ` Richard Stallman
2012-02-13 22:05       ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pqdiwmil.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.