X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=lisp%2Fpop3.el;h=327c52974925463d1bd7a4f403c9bd0aca0cbaf0;hp=d2953dcffc922e3e0e73fd6c3f955e119a5beb33;hb=3581db9320824d17bd7d19da11c7a0e1cd405076;hpb=60f3bccd1b6416278750cb85362503b8fcd55df9 diff --git a/lisp/pop3.el b/lisp/pop3.el index d2953dcff..327c52974 100644 --- a/lisp/pop3.el +++ b/lisp/pop3.el @@ -82,6 +82,15 @@ valid value is 'apop'." :version "22.1" ;; Oort Gnus :group 'pop3) +(defcustom pop3-stream-length 100 + "How many messages should be requested at one time. +The lower the number, the more latency-sensitive the fetching +will be. If your pop3 server doesn't support streaming at all, +set this to 1." + :type 'number + :version "24.1" + :group 'pop3) + (defcustom pop3-leave-mail-on-server nil "*Non-nil if the mail is to be left on the POP server after fetching. @@ -140,7 +149,7 @@ Use streaming commands." (let ((size (pop3-stat process))) (setq message-count (car size) message-total-size (cadr size))) - (when (plusp message-count) + (when (> message-count 0) (pop3-send-streaming-command process "RETR" message-count message-total-size) (pop3-write-to-file file) @@ -156,7 +165,7 @@ Use streaming commands." (while (>= count i) (process-send-string process (format "%s %d\r\n" command i)) ;; Only do 100 messages at a time to avoid pipe stalls. - (when (zerop (% i 100)) + (when (zerop (% i pop3-stream-length)) (pop3-wait-for-messages process i total-size)) (incf i))) (pop3-wait-for-messages process count total-size))