aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-06-02 04:58:10 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-06-02 04:58:10 +0000
commit79a2ab0985b5964aef6025edb7a625af4eebfd29 (patch)
tree7d18d7c00bb930fca348ccd5d1db6830a8867890
parentb0338391d385f9be0d5b64565ca269c07a208baf (diff)
downloadfetchmail-79a2ab0985b5964aef6025edb7a625af4eebfd29.tar.gz
fetchmail-79a2ab0985b5964aef6025edb7a625af4eebfd29.tar.bz2
fetchmail-79a2ab0985b5964aef6025edb7a625af4eebfd29.zip
Sometimes now we only count header bytes.
svn path=/trunk/; revision=1056
-rw-r--r--NEWS1
-rw-r--r--driver.c32
2 files changed, 30 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 9a677358..94fa8944 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,7 @@ pl 3.9.7 ():
* Treat exim's 501 antispam response as equivalent to 571. Note: this
is temporary. The right thing is to get exim to return 571; I'm
working on it.
+* Fess up to sometimes only counting header bytes in the progress messages.
There are 257 people on the fetchmail-friends list.
diff --git a/driver.c b/driver.c
index 14700a52..486c9c47 100644
--- a/driver.c
+++ b/driver.c
@@ -1426,7 +1426,13 @@ const struct method *proto; /* protocol method table */
count, count > 1 ? "s" : "", buf);
}
- /* we may need to get sizes in order to check message limits */
+ /*
+ * We may need to get sizes in order to check message
+ * limits. If we ever decide that always having accurate
+ * whole-message (as opposed to header) lengths in the
+ * progress messages is important, all we have to do is
+ * remove the `&& ctl->limit' here.
+ */
msgsizes = (int *)NULL;
if (!ctl->fetchall && proto->getsizes && ctl->limit)
{
@@ -1502,9 +1508,29 @@ const struct method *proto; /* protocol method table */
if (outlevel > O_SILENT)
{
+ int havesizes, mlen;
+
error_build("reading message %d", num);
- if (len > 0)
- error_build(" (%d bytes)", len);
+
+ if (!protocol->fetch_body)
+ {
+ havesizes = TRUE;
+ mlen = len;
+ }
+ else if (msgsizes)
+ {
+ havesizes = TRUE;
+ mlen = msgsizes[num - 1];
+ }
+ else /* no way to know body size yet */
+ {
+ havesizes = FALSE;
+ mlen = len;
+ }
+
+ if (mlen > 0)
+ error_build(" (%d %sbytes)",
+ mlen, havesizes ? "" : "header ");
if (outlevel == O_VERBOSE)
error_complete(0, 0, "");
else