diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-10-19 13:56:30 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-10-19 13:56:30 +0000 |
commit | 00fa03c8553785f9b123a8552d2b59266b418e2c (patch) | |
tree | eb3ffa304e375077153e1b57a4163f4197172851 /driver.c | |
parent | ed181f4aa1bfd899d57b0d00849346262003024b (diff) | |
download | fetchmail-00fa03c8553785f9b123a8552d2b59266b418e2c.tar.gz fetchmail-00fa03c8553785f9b123a8552d2b59266b418e2c.tar.bz2 fetchmail-00fa03c8553785f9b123a8552d2b59266b418e2c.zip |
Schwendt's correction to the sizeticker code.
svn path=/trunk/; revision=350
Diffstat (limited to 'driver.c')
-rw-r--r-- | driver.c | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -286,9 +286,22 @@ struct hostrec *queryctl; /* query control record */ headers = unixfrom = fromhdr = tohdr = cchdr = bcchdr = NULL; lines = 0; sizeticker = 0; - while (delimited || len > 0) { + while (delimited || len > 0) + { if ((n = SockGets(socket,buf,sizeof(buf))) < 0) return(PS_SOCKET); + + /* write the message size dots */ + if (n > 0) + { + sizeticker += n; + while (sizeticker >= SIZETICKER) + { + if (outlevel > O_SILENT && outlevel < O_VERBOSE) + fputc('.',stderr); + sizeticker -= SIZETICKER; + } + } len -= n; bufp = buf; if (buf[0] == '\0' || buf[0] == '\r' || buf[0] == '\n') @@ -452,18 +465,6 @@ struct hostrec *queryctl; /* query control record */ fputc('*', stderr); skipwrite:; - - /* write the message size dots */ - sizeticker += strlen(bufp); - while (sizeticker >= SIZETICKER) - { - if (outlevel > O_SILENT && outlevel < O_VERBOSE) - fputc('.',stderr); - sizeticker -= SIZETICKER; - - /* reset timeout so we don't choke on very long messages */ - alarm(queryctl->timeout); - } lines++; } |