]> Pileus Git - ~andy/fetchmail/commitdiff
Storage cleanup for new dup killer code.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 10 Oct 2003 20:49:49 +0000 (20:49 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 10 Oct 2003 20:49:49 +0000 (20:49 -0000)
svn path=/trunk/; revision=3855

fetchmail.h
pop3.c
transact.c

index 0c78133ada7652af32eea6e1e9bac55e2d7579f6..6665ab06f6eb7276f0be393f4a5e824b827f4b21 100644 (file)
@@ -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 */
diff --git a/pop3.c b/pop3.c
index 3d894160dd9c868841c67678d12aac9604269ea5..c1c46f9d8ac7e1b76f52476ce2e73951cb6726b4 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -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);
 }
 
index b6cdcc8ae39e61e78746a7c7e02bfb6061113742..843dd7ee5dd1369aff0a176c505c449aabf6c7ee 100644 (file)
@@ -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);
        }