]> Pileus Git - ~andy/fetchmail/commitdiff
Document the fact that TOP doesn't really let us do split fetches a la IMAP.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 26 Mar 1998 17:26:42 +0000 (17:26 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 26 Mar 1998 17:26:42 +0000 (17:26 -0000)
svn path=/trunk/; revision=1726

pop3.c

diff --git a/pop3.c b/pop3.c
index f189e39d68548e2b6bba4537c9f6b29a1e3584be..75fa0082fbcc59e9601eacf94326c360fd927b35 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -486,11 +486,36 @@ static int pop3_is_old(int sock, struct query *ctl, int num)
                            str_find (&ctl->newsaved, num)));
 }
 
+#ifdef UNUSED
+/*
+ * We could use this to fetch headers only as we do for IMAP.  The trouble 
+ * is that there's no way to fetch the body only.  So the following RETR 
+ * would have to re-fetch the header.  Enough messages have longer headers
+ * than bodies to make this a net loss.
+ */
+static int pop_fetch_headers(int sock, struct query *ctl,int number,int *lenp)
+/* request headers of nth message */
+{
+    int ok;
+    char buf[POPBUFSIZE+1];
+
+    /* phase = PHASE_FETCH */
+
+    gen_send(sock, "TOP %d 0", number);
+    if ((ok = pop3_ok(sock, buf)) != 0)
+       return(ok);
+
+    *lenp = -1;                /* we got sizes from the LIST response */
+
+    return(PS_SUCCESS);
+}
+#endif /* UNUSED */
+
 static int pop3_fetch(int sock, struct query *ctl, int number, int *lenp)
 /* request nth message */
 {
     int ok;
-    char buf [POPBUFSIZE+1];
+    char buf[POPBUFSIZE+1];
 
     /* phase = PHASE_FETCH */
 
@@ -500,7 +525,7 @@ static int pop3_fetch(int sock, struct query *ctl, int number, int *lenp)
 
     *lenp = -1;                /* we got sizes from the LIST response */
 
-    return(0);
+    return(PS_SUCCESS);
 }
 
 static int pop3_delete(int sock, struct query *ctl, int number)