]> granicus.if.org Git - curl/commitdiff
imap: Fixed error code returned for invalid FETCH response
authorJiri Hruska <jirka@fud.cz>
Thu, 28 Feb 2013 18:56:52 +0000 (19:56 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Thu, 28 Feb 2013 21:00:13 +0000 (21:00 +0000)
If the FETCH command does not result in an untagged response the the
UID is probably invalid. As such do not return CURLE_OK.

lib/imap.c

index a834c4e5f643fa4bc2c8824fe86277774bd9e825..c1ed8673b921f1d6aed63f9f574391d3cda07c7b 100644 (file)
@@ -1271,7 +1271,7 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode,
   if('*' != imapcode) {
     Curl_pgrsSetDownloadSize(data, 0);
     state(conn, IMAP_STOP);
-    return CURLE_OK;
+    return CURLE_REMOTE_FILE_NOT_FOUND; /* TODO: Fix error code */
   }
 
   /* Something like this comes "* 1 FETCH (BODY[TEXT] {2021}\r" */