Gnus development mailing list
 help / color / mirror / Atom feed
* patch for "POP SSL connexion failed"
@ 2007-11-13 20:40 Denys Duchier
  2007-11-14  8:47 ` Leo
  2007-11-16 20:07 ` rahed
  0 siblings, 2 replies; 7+ messages in thread
From: Denys Duchier @ 2007-11-13 20:40 UTC (permalink / raw)
  To: ding

I don't know if it was a change in gnus (I did not update in a very long
time) or a change in my POP server, but I have been getting something
like over 10 failed connexions for every 1 success ever since I cvs
up'ed.  Here is a fix that seems to work well for me:

cvs server: Diffing .
Index: pop3.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/pop3.el,v
retrieving revision 7.26
diff -u -r7.26 pop3.el
--- pop3.el	4 Oct 2007 18:51:28 -0000	7.26
+++ pop3.el	13 Nov 2007 20:35:35 -0000
@@ -241,16 +241,20 @@
 					      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)
-			     (pop3-quit process)
-			     (error "POP SSL connexion failed"))))
+		  (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")))))
 		  process)))
 	     ((eq pop3-stream-type 'starttls)
 	      ;; gnutls-cli, openssl don't accept service names


--Denys




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-11-16 20:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-13 20:40 patch for "POP SSL connexion failed" Denys Duchier
2007-11-14  8:47 ` Leo
2007-11-14 12:07   ` Katsumi Yamaoka
2007-11-14 15:28     ` Leo
2007-11-14 21:15     ` Denys Duchier
2007-11-14 22:16       ` Katsumi Yamaoka
2007-11-16 20:07 ` rahed

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).