diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-06-02 04:58:10 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-06-02 04:58:10 +0000 |
commit | 79a2ab0985b5964aef6025edb7a625af4eebfd29 (patch) | |
tree | 7d18d7c00bb930fca348ccd5d1db6830a8867890 | |
parent | b0338391d385f9be0d5b64565ca269c07a208baf (diff) | |
download | fetchmail-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-- | NEWS | 1 | ||||
-rw-r--r-- | driver.c | 32 |
2 files changed, 30 insertions, 3 deletions
@@ -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. @@ -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 |