[gnus git] branch master updated: m0-3-156-gc2040ca =1= pop3.el (pop3-wait-for-messages): Fix retrieved data size calculation.

Katsumi Yamaoka <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  c2040ca9a75bbfe1c064dd56f3effdc0280cc710 (commit)
      from  849a60a1e05de1a0526e32bcf8657c97df5aeec5 (commit)


- Log -----------------------------------------------------------------
commit c2040ca9a75bbfe1c064dd56f3effdc0280cc710
Author: Katsumi Yamaoka <[email protected]>
Date:   Wed Apr 25 11:19:25 2012 +0000

    pop3.el (pop3-wait-for-messages): Fix retrieved data size calculation.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cf92175..11c1aff 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2012-04-25  Katsumi Yamaoka  <[email protected]>
+
+	* pop3.el (pop3-wait-for-messages): Fix retrieved data size calculation.
+
 2012-04-19  Juanma Barranquero  <[email protected]>
 
 	* tls.el (open-tls-stream): Remove unused binding.
diff --git a/lisp/pop3.el b/lisp/pop3.el
index ee4345c..2533098 100644
--- a/lisp/pop3.el
+++ b/lisp/pop3.el
@@ -194,10 +194,16 @@ Use streaming commands."
     (unless (memq (process-status process) '(open run))
       (error "pop3 process died"))
     (when total-size
+      (let ((size 0))
+	(goto-char (point-min))
+	(while (re-search-forward "^\\+OK.*\n" nil t)
+	  (setq size (+ size (- (point))
+			(if (re-search-forward "^\\.\r?\n" nil 'move)
+			    (match-beginning 0)
+			  (point)))))
       (message "pop3 retrieved %dKB (%d%%)"
-	       (truncate (/ (buffer-size) 1000))
-	       (truncate (* (/ (* (buffer-size) 1.0)
-			       total-size) 100))))
+		 (truncate (/ size 1000))
+		 (truncate (* (/ (* size 1.0) total-size) 100)))))
     (pop3-accept-process-output process))
   start-point)
 

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    4 ++++
 lisp/pop3.el   |   14 ++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.