aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2006-03-04 13:52:24 +0000
committerMatthias Andree <matthias.andree@gmx.de>2006-03-04 13:52:24 +0000
commit3c2a789b856b8c6e99f7a5c0c3517a56204a7625 (patch)
tree66d1b2de7206ab81fe531f4c598850176786eb0d /pop3.c
parent76edebc28e569f94f357dc96adce4c135eebbcbe (diff)
downloadfetchmail-3c2a789b856b8c6e99f7a5c0c3517a56204a7625.tar.gz
fetchmail-3c2a789b856b8c6e99f7a5c0c3517a56204a7625.tar.bz2
fetchmail-3c2a789b856b8c6e99f7a5c0c3517a56204a7625.zip
Add comments to make the LAST/UIDL code easier to understand.
svn path=/branches/BRANCH_6-3/; revision=4721
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/pop3.c b/pop3.c
index 69a9c6f8..291327ac 100644
--- a/pop3.c
+++ b/pop3.c
@@ -888,12 +888,14 @@ static int pop3_getrange(int sock,
return(ok);
/*
- * Newer, RFC-1725-conformant POP servers may not have the LAST command.
- * We work as hard as possible to hide this ugliness, but it makes
+ * Newer, RFC-1725/1939-conformant POP servers may not have the LAST command.
+ * We work as hard as possible to hide this, but it makes
* counting new messages intrinsically quadratic in the worst case.
*/
last = 0;
*newp = -1;
+ /* if there are messages, and UIDL is desired, use UIDL
+ * also use UIDL if fetchall is unset */
if (*countp > 0 && (!ctl->fetchall || ctl->server.uidl))
{
int fastuidl;
@@ -919,8 +921,10 @@ static int pop3_getrange(int sock,
ok = pop3_ok(sock, buf);
} else
ok = 1;
+
if (ok == 0)
{
+ /* scan LAST reply */
if (sscanf(buf, "%d", &last) == 0)
{
report(stderr, GT_("protocol error\n"));
@@ -930,6 +934,7 @@ static int pop3_getrange(int sock,
}
else
{
+ /* do UIDL */
if (dofastuidl)
return(pop3_fastuidl( sock, ctl, *countp, newp));
/* grab the mailbox's UID list */
@@ -944,6 +949,7 @@ static int pop3_getrange(int sock,
}
else
{
+ /* UIDL worked - parse reply */
unsigned long unum;
*newp = 0;
@@ -995,9 +1001,9 @@ static int pop3_getrange(int sock,
}
} else
return PS_ERROR;
- }
- }
- }
+ } /* multi-line loop for UIDL reply */
+ } /* UIDL parser */
+ } /* do UIDL */
}
return(PS_SUCCESS);