diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2003-10-10 20:49:49 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2003-10-10 20:49:49 +0000 |
commit | d76c2a989ada984ace971fe86f9fc628b4e6358d (patch) | |
tree | 48ba8bd1bd1e9bfc8b0f5cf1182f719ab507bd29 | |
parent | c4cd27e0012f3a6b514eb75318e8bb74c5c33c11 (diff) | |
download | fetchmail-d76c2a989ada984ace971fe86f9fc628b4e6358d.tar.gz fetchmail-d76c2a989ada984ace971fe86f9fc628b4e6358d.tar.bz2 fetchmail-d76c2a989ada984ace971fe86f9fc628b4e6358d.zip |
Storage cleanup for new dup killer code.
svn path=/trunk/; revision=3855
-rw-r--r-- | fetchmail.h | 5 | ||||
-rw-r--r-- | pop3.c | 6 | ||||
-rw-r--r-- | transact.c | 8 |
3 files changed, 6 insertions, 13 deletions
diff --git a/fetchmail.h b/fetchmail.h index 0c78133a..6665ab06 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -315,12 +315,11 @@ struct query struct idlist *skipped; /* messages skipped on the mail server */ struct idlist *oldsaved, *newsaved; struct idlist **oldsavedend; - char thisid[16]; /* Message fingerprint for dup killing */ - char lastid[16]; /* last fingerprint seen on this connection */ + char lastdigest[DIGESTLEN]; /* last MD5 hash seen on this connection */ /* internal use -- per-message state */ int mimemsg; /* bitmask indicating MIME body-type */ - char digest [DIGESTLEN]; /* md5 digest buffer */ + char digest[DIGESTLEN]; /* md5 digest buffer */ /* internal use -- housekeeping */ struct query *next; /* next query control block in chain */ @@ -1004,12 +1004,6 @@ static int pop3_logout(int sock, struct query *ctl) if (!ok) expunge_uids(ctl); - if (ctl->lastid) - { - free(ctl->lastid); - ctl->lastid = NULL; - } - return(ok); } @@ -408,7 +408,7 @@ int readheaders(int sock, free(delivered_to); /* initially, no message digest */ - memset(ctl->thisid, '\0', sizeof(ctl->thisid)); + memset(ctl->digest, '\0', sizeof(ctl->digest)); msgblk.headers = received_for = delivered_to = NULL; from_offs = reply_to_offs = resent_from_offs = app_from_offs = @@ -921,7 +921,7 @@ int readheaders(int sock, MD5Init(&context); MD5Update(&context, msgblk.headers, strlen(msgblk.headers)); - MD5Final(ctl->thisid, &context); + MD5Final(ctl->digest, &context); if (!received_for && env_offs == -1 && !delivered_to) { @@ -930,8 +930,8 @@ int readheaders(int sock, * If so there is a one in 18-quadrillion chance this * code will incorrectly nuke the first message. */ - if (memcmp(ctl->lastid, ctl->thisid, sizeof(ctl->lastid))) - ctl->lastid = ctl->thisid; + if (memcmp(ctl->lastdigest, ctl->digest, DIGESTLEN)) + memcpy(ctl->lastdigest, ctl->digest, DIGESTLEN); else if (accept_count > 1) return(PS_REFUSED); } |