diff options
Diffstat (limited to 'driver.c')
-rw-r--r-- | driver.c | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -83,9 +83,7 @@ static int tagnum; static char *shroud; /* string to shroud in debug output, if non-NULL */ static int mytimeout; /* value of nonreponse timeout */ -#ifdef MSGLEN static int msglen; /* actual message length */ -#endif /* MSGLEN */ static void set_timeout(int timeleft) /* reset the nonresponse-timeout */ @@ -524,9 +522,8 @@ int num; /* index of message */ headers = received_for = NULL; from_offs = ctt_offs = env_offs = -1; oldlen = 0; -#ifdef MSGLEN msglen = 0; -#endif /* MSGLEN */ + for (remaining = len; remaining > 0 || protocol->delimited; remaining -= linelen) { char *line; @@ -538,9 +535,7 @@ int num; /* index of message */ if ((n = SockRead(sock, buf, sizeof(buf)-1)) == -1) return(PS_SOCKET); linelen += n; -#ifdef MSGLEN msglen += n; -#endif /* MSGLEN */ /* lines may not be properly CRLF terminated; fix this for qmail */ if (ctl->forcecr) @@ -1217,9 +1212,6 @@ flag forward; /* TRUE to forward */ } } len -= linelen; -#ifdef MSGLEN - msglen += linelen; -#endif /* MSGLEN */ /* check for end of message */ if (protocol->delimited && *buf == '.') @@ -1227,6 +1219,10 @@ flag forward; /* TRUE to forward */ break; else if (buf[1] == '\n' && buf[2] == '\0') break; + else + msglen--; /* subtract the size of the dot escape */ + + msglen += linelen; /* ship out the text line */ if (forward) @@ -1738,11 +1734,9 @@ const struct method *proto; /* protocol method table */ } } -#ifdef MSGLEN /* check to see if the numbers matched? */ if (msgsizes && msglen != msgsizes[num-1]) error(0, 0, "size of message %d (%d) was not what was expected (%d)", num, msglen, msgsizes[num-1]); -#endif /* MSGLEN */ /* end-of-message processing starts here */ if (outlevel == O_VERBOSE) |