From: Tomasz Gajewski <tomga@wp.pl>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Infinite loop in pop3-retr
Date: Fri, 27 May 2011 11:33:25 +0200 [thread overview]
Message-ID: <87d3j4lc7u.fsf@vitiris.tt.com.pl> (raw)
In-Reply-To: <jwvaae9asmm.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 26 May 2011 21:35:34 -0300")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> Sometimes during retrieving mail through pop3 in gnus I emacs loops
>> infinitely in pop3-retr. It seems to be somehow connected with some
>> buggy mail. Normally I didn't have time to investigate it thoroughly
>> (I haven't used emacs debugger yet) but this time I think I've found
>> out enough to make this problem fixed by someone.
>>
>> Problem is inside:
>> (set-buffer (process-buffer process))
>> (while (not (re-search-forward "^\\.\r\n" nil t))
>> (pop3-accept-process-output process)
>> (goto-char start))
>
>> If I correctly read it this code assumes that in (process-buffer
>> process) finally will contain line with dot only but this never
>> happens probably due to information found at the end of trace of pop
>> session to server saying:
>
>> Process POP connection broken by remote peer.
>
>> Can you propose some fix for this?
>
> The while should also test whether the `process' is still alive. Or
> else, pop3-accept-process-output should somehow signal an error if
> `process' is not alive any more.
I have no experience with emacs lisp programming and I don't like my
solution (but it is the only one I could find).
(set-buffer (process-buffer process))
(while (and (not (re-search-forward "^\\.\r\n" nil t))
(member (process-status process)
(list 'run 'stop 'open
'listen 'connect)))
(pop3-accept-process-output process)
(goto-char start))
Firstly, I think that probably there is a simpler way to check if
process is active than by testing process status but I don't know that.
Secondly, I can't test this code right now becuase problem happens only
sometimes.
Can someone with more experience update this code (or maybe say that it
is not required)?
Should I sent a bug report with those informations somewhere (gnus bugs
list, emacs bugs list) or is it sufficient leave it here?
Regards
--
Tomasz Gajewski
next prev parent reply other threads:[~2011-05-27 9:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-26 8:43 Infinite loop in pop3-retr tomga
2011-05-27 0:35 ` Stefan Monnier
2011-05-27 9:33 ` Tomasz Gajewski [this message]
2011-05-27 12:55 ` Stefan Monnier
2011-05-30 17:21 ` Lars Magne Ingebrigtsen
2011-05-31 1:12 ` Stefan Monnier
2011-05-31 18:22 ` Lars Magne Ingebrigtsen
2011-05-31 21:45 ` Stefan Monnier
2011-06-01 11:48 ` Lars Magne Ingebrigtsen
2011-06-12 22:43 ` Chong Yidong
2011-06-14 14:58 ` Lars Magne Ingebrigtsen
2011-05-30 17:18 ` Lars Magne Ingebrigtsen
2011-05-31 6:36 ` Tomasz Gajewski
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=87d3j4lc7u.fsf@vitiris.tt.com.pl \
--to=tomga@wp.pl \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.