aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-06-05 20:41:35 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-06-05 20:41:35 +0000
commit3e5b4dd8260187175b66e1943f686939b5d2c628 (patch)
tree88649f19f841a7e9d3ac6dde16214c213e928bec
parente524c7847c4c0b901d10e00512568f467567b4c7 (diff)
downloadfetchmail-3e5b4dd8260187175b66e1943f686939b5d2c628.tar.gz
fetchmail-3e5b4dd8260187175b66e1943f686939b5d2c628.tar.bz2
fetchmail-3e5b4dd8260187175b66e1943f686939b5d2c628.zip
Yet another step towards zero-length message handling.
svn path=/trunk/; revision=1067
-rw-r--r--driver.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/driver.c b/driver.c
index cf58c145..75e2094e 100644
--- a/driver.c
+++ b/driver.c
@@ -1555,35 +1555,42 @@ const struct method *proto; /* protocol method table */
* or other PS_REFUSED error response during
* read_headers.
*/
- if (protocol->fetch_body && !suppress_forward)
+ if (protocol->fetch_body)
{
if ((ok = (protocol->trail)(sock, ctl, num)))
goto cleanUp;
set_timeout(ctl->server.timeout);
- if ((ok = (protocol->fetch_body)(sock, ctl, num, &len)))
- goto cleanUp;
- set_timeout(ctl->server.timeout);
+ len = 0;
+ if (!suppress_forward)
+ {
+ if ((ok=(protocol->fetch_body)(sock,ctl,num,&len)))
+ goto cleanUp;
+ set_timeout(ctl->server.timeout);
+ }
}
/* process the body now */
- ok = readbody(sock,
- ctl,
- !suppress_forward,
- len,
- protocol->delimited);
- if (ok == PS_TRANSIENT)
- suppress_delete = TRUE;
- else if (ok)
- goto cleanUp;
- set_timeout(ctl->server.timeout);
-
- /* tell the server we got it OK and resynchronize */
- if (protocol->trail)
+ if (len > 0)
{
- ok = (protocol->trail)(sock, ctl, num);
- if (ok != 0)
+ ok = readbody(sock,
+ ctl,
+ !suppress_forward,
+ len,
+ protocol->delimited);
+ if (ok == PS_TRANSIENT)
+ suppress_delete = TRUE;
+ else if (ok)
goto cleanUp;
set_timeout(ctl->server.timeout);
+
+ /* tell server we got it OK and resynchronize */
+ if (protocol->trail)
+ {
+ ok = (protocol->trail)(sock, ctl, num);
+ if (ok != 0)
+ goto cleanUp;
+ set_timeout(ctl->server.timeout);
+ }
}
fetches++;