From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: gnutls infloop possibly fixed Date: Mon, 13 Feb 2012 20:39:46 +0100 Organization: Programmerer Ingebrigtsen Message-ID: <87pqdiwmil.fsf@gnus.org> References: <87hayx8feo.fsf@gnus.org> <87ehu0lqc7.fsf@lifelogs.com> <87fwefj0l9.fsf@gnus.org> <871upypwd5.fsf@fleche.redhat.com> <8762fawntj.fsf@gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1329162018 26564 80.91.229.3 (13 Feb 2012 19:40:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Feb 2012 19:40:18 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 13 20:40:17 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rx1kv-000717-21 for ged-emacs-devel@m.gmane.org; Mon, 13 Feb 2012 20:40:09 +0100 Original-Received: from localhost ([::1]:55585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rx1ku-0004cO-CB for ged-emacs-devel@m.gmane.org; Mon, 13 Feb 2012 14:40:08 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:49987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rx1kl-0004aR-CJ for emacs-devel@gnu.org; Mon, 13 Feb 2012 14:40:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rx1kj-0005Nt-Oc for emacs-devel@gnu.org; Mon, 13 Feb 2012 14:39:59 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:53708) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rx1kj-0005Nb-JV for emacs-devel@gnu.org; Mon, 13 Feb 2012 14:39:57 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Rx1kg-0006kJ-W7 for emacs-devel@gnu.org; Mon, 13 Feb 2012 20:39:55 +0100 Original-Received: from 93-41-188-50.ip82.fastwebnet.it ([93.41.188.50]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Feb 2012 20:39:54 +0100 Original-Received: from larsi by 93-41-188-50.ip82.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Feb 2012 20:39:54 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 45 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 93-41-188-50.ip82.fastwebnet.it Mail-Copies-To: never User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux) Cancel-Lock: sha1:3D3Hm8fqyzbwzqTGzk8z8nEyyso= 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:148568 Archived-At: 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