imap: Removed bytecountp from the per-request structure
authorJiri Hruska <jirka@fud.cz>
Mon, 25 Feb 2013 17:40:32 +0000 (18:40 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Mon, 25 Feb 2013 22:05:20 +0000 (22:05 +0000)
Removed this pointer to a downloaded bytes counter because it was set in
imap_init() to point to the same variable the transfer functions keep
the count in (k->bytecount), effectively making the code in transfer.c
"*k->bytecountp = k->bytecount" a no-op.

lib/imap.c
lib/imap.h

index 847acd74ad7bcb435ecebea1a5b6d6c2b1e30f75..d219b745472f352838a17366041fad537e8c87f4 100644 (file)
@@ -1185,7 +1185,6 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode,
   CURLcode result = CURLE_OK;
   struct SessionHandle *data = conn->data;
   struct imap_conn *imapc = &conn->proto.imapc;
-  struct IMAP *imap = data->state.proto.imap;
   struct pingpong *pp = &imapc->pp;
   const char *ptr = data->state.buffer;
 
@@ -1246,7 +1245,7 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode,
       Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
     else
       /* IMAP download */
-      Curl_setup_transfer(conn, FIRSTSOCKET, size, FALSE, imap->bytecountp,
+      Curl_setup_transfer(conn, FIRSTSOCKET, size, FALSE, NULL,
                           -1, NULL); /* no upload here */
 
     data->req.maxdownload = size;
@@ -1411,9 +1410,6 @@ static CURLcode imap_init(struct connectdata *conn)
       return CURLE_OUT_OF_MEMORY;
   }
 
-  /* Get some initial data into the imap struct */
-  imap->bytecountp = &data->req.bytecount;
-
   return CURLE_OK;
 }
 
index 09c296f4c56d9c9fdcb10365073ecfff29312c83..08c35b6305daba36245a09a02db2fb29f435c29e 100644 (file)
@@ -56,7 +56,6 @@ typedef enum {
    perhaps the SessionHandle is changed between the times the connection is
    used. */
 struct IMAP {
-  curl_off_t *bytecountp;
   curl_pp_transfer transfer;
   char *mailbox;          /* Mailbox to select */
   char *uidvalidity;      /* UIDVALIDITY to check in select */