From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/61597 Path: news.gmane.org!not-for-mail From: Wolfram Fenske Newsgroups: gmane.emacs.gnus.general Subject: FIXED (was: Fwd: Updating Inbox hangs (and I know why)) Date: Thu, 22 Dec 2005 00:53:15 +0100 Message-ID: <84u0d2yplg.fsf_-_@www.uni-magdeburg.de> References: <84fyp2x1hg.fsf@www.uni-magdeburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Trace: sea.gmane.org 1135209530 18108 80.91.229.2 (21 Dec 2005 23:58:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Dec 2005 23:58:50 +0000 (UTC) Cc: Simon Josefsson Original-X-From: ding-owner+m10129@lists.math.uh.edu Thu Dec 22 00:58:47 2005 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EpDqz-00036q-5L for ding-account@gmane.org; Thu, 22 Dec 2005 00:58:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1EpDqu-0005VA-00; Wed, 21 Dec 2005 17:58:36 -0600 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1EpDlw-0005V5-00 for ding@lists.math.uh.edu; Wed, 21 Dec 2005 17:53:28 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1EpDlu-0003JF-6v for ding@lists.math.uh.edu; Wed, 21 Dec 2005 17:53:28 -0600 Original-Received: from mail.uni-magdeburg.de ([141.44.1.10]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1EpDlt-0004ny-00 for ; Thu, 22 Dec 2005 00:53:25 +0100 Original-Received: from sunny.urz.uni-magdeburg.de ([141.44.8.7]) by mail.uni-magdeburg.de with esmtp (EXIM Version 4.43) id 1EpDlp-0000L4-4k; Thu, 22 Dec 2005 00:53:25 +0100 Original-Received: from hondo (pD9514F01.dip0.t-ipconnect.de [217.81.79.1]) (authenticated bits=0) by sunny.urz.uni-magdeburg.de (8.12.10/8.12.10) with ESMTP id jBLNrHq2021054 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 22 Dec 2005 00:53:19 +0100 Original-To: ding@gnus.org In-Reply-To: (Simon Josefsson's message of "Wed, 14 Dec 2005 20:12:17 +0100") User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.17 (Jumbo Shrimp, cygwin32) X-Spam-Score: -2.6 (--) X-Spam-Report: ---- Start SpamAssassin results -2.6 points, 5.0 required; -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] 0.0 AWL AWL: From: address is in the auto white-list ---- End of SpamAssassin results X-Scan-Signature: 97c589d86249e00b2b3dfe1152414e09 X-Spam-Score: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:61597 Archived-At: Hello! I have figured out a solution now: when imap-wait-for-tag discovers that the imap process has exited, it throws an exception. nnimap-request-update-info-internal catches it. If an exception occurred, nnimap-request-update-info-internal closes the current connection, opens a new one and starts itself again. If no exception occurred, it behaves as usual. Here's what I did to imap.el, revision 1.26: 1810a1811,1812 > (unless (memq (process-status imap-process) '(open run)) > (throw :process-dead :process-dead)) and to nnimap.el, revision 1.29: 1119c1119 < (deffoo nnimap-request-update-info-internal (group info &optional server) --- > (deffoo nnimap-request-update-info-internal-1 (group info &optional server) 1180a1181,1191 > (deffoo nnimap-request-update-info-internal (group info &optional server) > (let ((main (lambda () (nnimap-request-update-info-internal-1 > group info server)))) > (let ((result (catch :process-dead (funcall main)))) > (if (eql result :process-dead) > (with-current-buffer nnimap-server-buffer > (nnimap-close-server server) > (nnimap-open-connection server) > (funcall main)) > result)))) > This patch makes nnimap do exactly what I want it to: use the current connection if possible and open a new one if it died. Maybe my solution isn't a clean way to do that, but so far, it seems to work OK. I still have some related problems, though. E.g. when I exit the summar buffer after longer period of time, my exception from imap.el also gets thrown but naturally isn't caught. I suppose this function has the same problem as nnimap-request-update-info-internal and could be fixed in the same way. It's interesting that the imap process can still be alive at the beginning of nnimap-request-update-info-internal but be dead in imap-wait-for-tag, which is called by nnimap-request-update-info-internal. I guess what happens is that the server silently closes the connection, but gnutls-cli (yes, I use gnutls-cli) doesn't notice it until it tries to communicate with the server again. And when it does notice it, the imap process/gnutls-cli dies. I would like to reopen the connection directly in imap-wait-for-tag, but can't, because other functions don't realize that the process handle has changed (or something to that effect). That's why I used exceptions to do it. What do you think? If I can help you with this issue I'd be happy to do so. Regards Wolfram Fenske