summaryrefslogtreecommitdiff
path: root/lisp/gnus/pop3.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-11-19 05:50:39 +0000
committerMiles Bader <miles@gnu.org>2007-11-19 05:50:39 +0000
commit1428d46be965cc483bf9cd55185c86cfc67d4b8d (patch)
tree8b93f344df5e95de9688e6f60d315fe17eae7bfc /lisp/gnus/pop3.el
parent282e1e37cb1100b5549fe987ef1882e9be670375 (diff)
downloademacs-1428d46be965cc483bf9cd55185c86cfc67d4b8d.tar.gz
Merge from gnus--devo--0
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-933
Diffstat (limited to 'lisp/gnus/pop3.el')
-rw-r--r--lisp/gnus/pop3.el25
1 files changed, 16 insertions, 9 deletions
diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el
index 595d0c2ff64..d152c2480ad 100644
--- a/lisp/gnus/pop3.el
+++ b/lisp/gnus/pop3.el
@@ -242,16 +242,23 @@ Returns the process associated with the connection."
mailhost port)))
(when process
;; There's a load of info printed that needs deleting.
- (while (when (memq (process-status process) '(open run))
- (pop3-accept-process-output process)
- (goto-char (point-max))
- (forward-line -1)
- (if (looking-at "\\+OK")
- (progn
- (delete-region (point-min) (point))
- nil)
+ (let ((again 't))
+ ;; repeat until
+ ;; - either we received the +OK line
+ ;; - or accept-process-output timed out without getting
+ ;; anything
+ (while (and again
+ (setq again (memq (process-status process)
+ '(open run))))
+ (setq again (pop3-accept-process-output process))
+ (goto-char (point-max))
+ (forward-line -1)
+ (cond ((looking-at "\\+OK")
+ (setq again nil)
+ (delete-region (point-min) (point)))
+ ((not again)
(pop3-quit process)
- (error "POP SSL connexion failed"))))
+ (error "POP SSL connexion failed")))))
process)))
((eq pop3-stream-type 'starttls)
;; gnutls-cli, openssl don't accept service names