diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-06-05 20:41:35 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-06-05 20:41:35 +0000 |
commit | 3e5b4dd8260187175b66e1943f686939b5d2c628 (patch) | |
tree | 88649f19f841a7e9d3ac6dde16214c213e928bec | |
parent | e524c7847c4c0b901d10e00512568f467567b4c7 (diff) | |
download | fetchmail-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.c | 45 |
1 files changed, 26 insertions, 19 deletions
@@ -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++; |