diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-03-24 01:27:54 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-03-24 01:27:54 +0000 |
commit | 82bbe2cb114ed913133261c19f3ff04097865d3d (patch) | |
tree | 5faf07641299cfaeedf428430bd9d09549db13ae | |
parent | 6ea6d46ba082a890320159232b53760cfc37c052 (diff) | |
download | fetchmail-82bbe2cb114ed913133261c19f3ff04097865d3d.tar.gz fetchmail-82bbe2cb114ed913133261c19f3ff04097865d3d.tar.bz2 fetchmail-82bbe2cb114ed913133261c19f3ff04097865d3d.zip |
Added byte count in status message.
svn path=/trunk/; revision=1721
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | driver.c | 47 |
2 files changed, 28 insertions, 21 deletions
@@ -9,7 +9,6 @@ * Handle multi-homed hosts correctly. * Add an "ident" per-user option for debugging that produces an "X-Fetchmail-ID" header in fetched messages for debugging. -* Total byte count in status message? * -U/--userdefault option to specify postmaster overriding USER. Release Notes: @@ -19,6 +18,7 @@ fetchmail-4.4.1 (): * We now properly shroud IMAP passwords containing ", \, and SP. * Checked for Y2K safety. No 2-digit dates anywhere, so we're safe. * Added mimedecode option by Henrik Storner. +* Display a total byte count in the mail count message. There are 274 people on fetchmail-friends and 164 on fetchmail-announce. @@ -1959,6 +1959,33 @@ const struct method *proto; /* protocol method table */ if (ok != 0) goto cleanUp; + /* + * We need the size of each message before it's + * loaded in order to pass via the ESMTP SIZE + * option. If the protocol has a getsizes method, + * we presume this means it doesn't get reliable + * sizes from message fetch responses. + */ + if (count > 0 && proto->getsizes) + { + int i; + + msgsizes = (int *)alloca(sizeof(int) * count); + for (i = 0; i < count; i++) + msgsizes[i] = -1; + + ok = (proto->getsizes)(sock, count, msgsizes); + if (ok != 0) + goto cleanUp; + + if (bytes == -1) + { + bytes = 0; + for (i = 0; i < count; i++) + bytes += msgsizes[i]; + } + } + /* show user how many messages we downloaded */ if (idp->id) (void) sprintf(buf, "%s at %s (folder %s)", @@ -2030,26 +2057,6 @@ const struct method *proto; /* protocol method table */ */ force_retrieval = !peek_capable && (ctl->errcount > 0); - /* - * We need the size of each message before it's - * loaded in order to pass via the ESMTP SIZE - * option. If the protocol has a getsizes method, - * we presume this means it doesn't get reliable - * sizes from message fetch responses. - */ - if (proto->getsizes) - { - int i; - - msgsizes = (int *)alloca(sizeof(int) * count); - for (i = 0; i < count; i++) - msgsizes[i] = -1; - - ok = (proto->getsizes)(sock, count, msgsizes); - if (ok != 0) - goto cleanUp; - } - /* read, forward, and delete messages */ for (num = 1; num <= count; num++) { |