]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
errors: new alias CURLE_WEIRD_SERVER_REPLY (8)
authorJay Satiro <raysatiro@yahoo.com>
Mon, 22 Aug 2016 19:37:03 +0000 (15:37 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 8 Sep 2016 01:24:27 +0000 (21:24 -0400)
Since we're using CURLE_FTP_WEIRD_SERVER_REPLY in imap, pop3 and smtp as
more of a generic "failed to parse" introduce an alias without FTP in
the name.

Closes https://github.com/curl/curl/pull/975

15 files changed:
docs/curl.1
docs/libcurl/libcurl-errors.3
docs/libcurl/symbols-in-versions
include/curl/curl.h
lib/ftp.c
lib/imap.c
lib/pop3.c
lib/smtp.c
lib/strerror.c
packages/OS400/curl.inc.in
packages/vms/curlmsg.h
packages/vms/curlmsg.msg
packages/vms/curlmsg.sdl
packages/vms/curlmsg_vms.h
tests/data/test2045

index 7a6cbbd5a40440c2b297596bb10c00f44ca59afc..9f657ddb3f1729810a0c8e7565b6fcddf9b2f1ac 100644 (file)
@@ -2254,7 +2254,7 @@ Couldn't resolve host. The given remote host was not resolved.
 .IP 7
 Failed to connect to host.
 .IP 8
-FTP weird server reply. The server sent data curl couldn't parse.
+Weird server reply. The server sent data curl couldn't parse.
 .IP 9
 FTP access denied. The server denied login or denied access to the particular
 resource or directory you wanted to reach. Most often you tried to change to a
index 0a21a7589cec88922f87444ea9282c22c520fe03..1b6e34f51380948ab133b22156a3b3b4be985a6f 100644 (file)
@@ -60,9 +60,8 @@ Couldn't resolve host. The given remote host was not resolved.
 .IP "CURLE_COULDNT_CONNECT (7)"
 Failed to connect() to host or proxy.
 .IP "CURLE_FTP_WEIRD_SERVER_REPLY (8)"
-After connecting to a FTP server, libcurl expects to get a certain reply
-back. This error code implies that it got a strange or bad reply. The given
-remote server is probably not an OK FTP server.
+The server sent data libcurl couldn't parse. This error code is used for more
+than just FTP and is aliased as \fICURLE_WEIRD_SERVER_REPLY\fP since 7.51.0.
 .IP "CURLE_REMOTE_ACCESS_DENIED (9)"
 We were denied access to the resource given in the URL.  For FTP, this occurs
 while trying to change to the remote directory.
index 5aadef2a69e4fb165b30467d81f94ab16f986b1a..e613195466fe91425399f6c78f47a800f58db05e 100644 (file)
@@ -140,6 +140,7 @@ CURLE_UPLOAD_FAILED             7.16.3
 CURLE_URL_MALFORMAT             7.1
 CURLE_URL_MALFORMAT_USER        7.1           7.17.0
 CURLE_USE_SSL_FAILED            7.17.0
+CURLE_WEIRD_SERVER_REPLY        7.51.0
 CURLE_WRITE_ERROR               7.1
 CURLFILETYPE_DEVICE_BLOCK       7.21.0
 CURLFILETYPE_DEVICE_CHAR        7.21.0
index bba1e6d3b6b7c35fba0210a7f6dd24f6da92c7ea..0ac238c28125cc5254ac56c6bae293be6b4955e4 100644 (file)
@@ -435,7 +435,7 @@ typedef enum {
   CURLE_COULDNT_RESOLVE_PROXY,   /* 5 */
   CURLE_COULDNT_RESOLVE_HOST,    /* 6 */
   CURLE_COULDNT_CONNECT,         /* 7 */
-  CURLE_FTP_WEIRD_SERVER_REPLY,  /* 8 */
+  CURLE_WEIRD_SERVER_REPLY,      /* 8 */
   CURLE_REMOTE_ACCESS_DENIED,    /* 9 a service was denied by the server
                                     due to lack of access - when login fails
                                     this is not returned. */
@@ -566,6 +566,7 @@ typedef enum {
 
 /*  compatibility with older names */
 #define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
+#define CURLE_FTP_WEIRD_SERVER_REPLY CURLE_WEIRD_SERVER_REPLY
 
 /* The following were added in 7.21.5, April 2011 */
 #define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
index 4c369973fcc0e79bc1ed655ca06b60152bb4c26b..3e8a22be947eee7bbc1a141095a9049023ca70d2 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -475,7 +475,7 @@ static CURLcode ReceivedServerConnect(struct connectdata *conn, bool *received)
       if(ftpcode/100 > 3)
         return CURLE_FTP_ACCEPT_FAILED;
 
-      return CURLE_FTP_WEIRD_SERVER_REPLY;
+      return CURLE_WEIRD_SERVER_REPLY;
     }
 
     break;
@@ -1835,7 +1835,7 @@ static CURLcode ftp_epsv_disable(struct connectdata *conn)
   if(conn->bits.ipv6) {
     /* We can't disable EPSV when doing IPv6, so this is instead a fail */
     failf(conn->data, "Failed EPSV attempt, exiting\n");
-    return CURLE_FTP_WEIRD_SERVER_REPLY;
+    return CURLE_WEIRD_SERVER_REPLY;
   }
 
   infof(conn->data, "Failed EPSV attempt. Disabling EPSV\n");
@@ -2742,7 +2742,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
       else if(ftpcode != 220) {
         failf(data, "Got a %03d ftp-server response when 220 was expected",
               ftpcode);
-        return CURLE_FTP_WEIRD_SERVER_REPLY;
+        return CURLE_WEIRD_SERVER_REPLY;
       }
 
       /* We have received a 220 response fine, now we proceed. */
index 123ea3b26b9a4fa50d636e05c328cf123668c1ec..50a35128446e4712fa5e114a90100cbbc9bb8e54 100644 (file)
@@ -846,7 +846,7 @@ static CURLcode imap_state_servergreet_resp(struct connectdata *conn,
 
   if(imapcode != 'O') {
     failf(data, "Got unexpected imap-server response");
-    result = CURLE_FTP_WEIRD_SERVER_REPLY; /* TODO: fix this code */
+    result = CURLE_WEIRD_SERVER_REPLY;
   }
   else
     result = imap_perform_capability(conn);
@@ -1179,7 +1179,7 @@ static CURLcode imap_state_fetch_resp(struct connectdata *conn, int imapcode,
   else {
     /* We don't know how to parse this line */
     failf(pp->conn->data, "Failed to parse FETCH response.");
-    result = CURLE_FTP_WEIRD_SERVER_REPLY; /* TODO: fix this code */
+    result = CURLE_WEIRD_SERVER_REPLY;
   }
 
   /* End of DO phase */
@@ -1198,7 +1198,7 @@ static CURLcode imap_state_fetch_final_resp(struct connectdata *conn,
   (void)instate; /* No use for this yet */
 
   if(imapcode != 'O')
-    result = CURLE_FTP_WEIRD_SERVER_REPLY; /* TODO: Fix error code */
+    result = CURLE_WEIRD_SERVER_REPLY;
   else
     /* End of DONE phase */
     state(conn, IMAP_STOP);
@@ -1275,7 +1275,7 @@ static CURLcode imap_statemach_act(struct connectdata *conn)
 
     /* Was there an error parsing the response line? */
     if(imapcode == -1)
-      return CURLE_FTP_WEIRD_SERVER_REPLY;
+      return CURLE_WEIRD_SERVER_REPLY;
 
     if(!imapcode)
       break;
index 591e877f55552b5cd2668ee80189c26bf1f6bc83..154e5c38bdee0f8e2d737678d0672d28d602966b 100644 (file)
@@ -663,7 +663,7 @@ static CURLcode pop3_state_servergreet_resp(struct connectdata *conn,
 
   if(pop3code != '+') {
     failf(data, "Got unexpected pop3-server response");
-    result = CURLE_FTP_WEIRD_SERVER_REPLY;
+    result = CURLE_WEIRD_SERVER_REPLY;
   }
   else {
     /* Does the server support APOP authentication? */
index d203b53238f031d7d1dffd075f5ed1a21c6ac465..98504df798cc70eacdd1825ae3c6b9d2989885cf 100644 (file)
@@ -674,7 +674,7 @@ static CURLcode smtp_state_servergreet_resp(struct connectdata *conn,
 
   if(smtpcode/100 != 2) {
     failf(data, "Got unexpected smtp-server response: %d", smtpcode);
-    result = CURLE_FTP_WEIRD_SERVER_REPLY;
+    result = CURLE_WEIRD_SERVER_REPLY;
   }
   else
     result = smtp_perform_ehlo(conn);
index 0e268d5e3f6e3d911a11ded29a9a2ca7022ad9c0..9c58e6b7735053de6d34db94e96a9fdd4805ab7e 100644 (file)
@@ -79,8 +79,8 @@ curl_easy_strerror(CURLcode error)
   case CURLE_COULDNT_CONNECT:
     return "Couldn't connect to server";
 
-  case CURLE_FTP_WEIRD_SERVER_REPLY:
-    return "FTP: weird server reply";
+  case CURLE_WEIRD_SERVER_REPLY:
+    return "Weird server reply";
 
   case CURLE_REMOTE_ACCESS_DENIED:
     return "Access denied to remote resource";
index 1e8a93dd1df6f55b5c1ce6fc94af5f6f55d338a9..486f655e9e1d3638a77786832983b7577eeb57bb 100644 (file)
      d                 c                   6
      d  CURLE_COULDNT_CONNECT...
      d                 c                   7
+     d  CURLE_WEIRD_SERVER_REPLY...
+     d                 c                   8
      d  CURLE_FTP_WEIRD_SERVER_REPLY...
      d                 c                   8
      d  CURLE_REMOTE_ACCESS_DENIED...
index 2cb32ec1ccf0219a972984b227166d9738c300b8..424a382f0a32fb5638c910a0361c6d62c5b4d845 100644 (file)
@@ -57,7 +57,8 @@
 #define CURL_COULDNT_RESOLVE_PROXY 251756594
 #define CURL_COULDNT_RESOLVE_HOST 251756602
 #define CURL_COULDNT_CONNECT 251756610
-#define CURL_FTP_WEIRD_SERVER_REPLY 251756618
+#define CURL_WEIRD_SERVER_REPLY 251756618
+#define CURL_FTP_WEIRD_SERVER_REPLY CURL_WEIRD_SERVER_REPLY
 #define CURL_FTP_ACCESS_DENIED 251756626
 #define CURL_OBSOLETE10 251756634
 #define CURL_FTP_WEIRD_PASS_REPLY 251756642
index 7fd44835383f2998392169fd03bd29647bf835c9..492657c02f0c325c77ff33e63edeac49f0d95a7a 100644 (file)
@@ -30,7 +30,7 @@ OBSOLETE4             <obsolete error code>
 COULDNT_RESOLVE_PROXY  <could not resolve proxy>
 COULDNT_RESOLVE_HOST   <could not resolve host>
 COULDNT_CONNECT                <could not connect>
-FTP_WEIRD_SERVER_REPLY <FTP weird server reply>
+WEIRD_SERVER_REPLY     <weird server reply>
 FTP_ACCESS_DENIED      <FTP access denied>
 OBSOLETE10             <obsolete error code>
 FTP_WEIRD_PASS_REPLY   <FTP weird PASS reply>
index e192c0750818e8495f9623fb1771c570f899ade5..db5baad606f0b799cd1b1bf4a4b7b68ff5648e07 100644 (file)
@@ -34,6 +34,7 @@
        ,"COULDNT_RESOLVE_PROXY" EQUALS %X0F018032 PREFIX "CURL" TAG ""
        ,"COULDNT_RESOLVE_HOST" EQUALS %X0F01803A PREFIX "CURL" TAG ""
        ,"COULDNT_CONNECT" EQUALS %X0F018042  PREFIX "CURL" TAG ""
+       ,"WEIRD_SERVER_REPLY" EQUALS %X0F01804A PREFIX "CURL" TAG ""
        ,"FTP_WEIRD_SERVER_REPLY" EQUALS %X0F01804A PREFIX "CURL" TAG ""
        ,"FTP_ACCESS_DENIED" EQUALS %X0F018052 PREFIX "CURL" TAG ""
        ,"OBSOLETE10"   EQUALS %X0F01805A     PREFIX "CURL" TAG ""
index 3aef9cfea70ab165758113c91309c71f5875950f..b7ff7a0cb2f43e3a736b64860b0721cd9f8f742f 100644 (file)
@@ -59,7 +59,7 @@ static const long vms_cond[] =
        CURL_COULDNT_RESOLVE_PROXY,
        CURL_COULDNT_RESOLVE_HOST,
        CURL_COULDNT_CONNECT,
-       CURL_FTP_WEIRD_SERVER_REPLY,
+       CURL_WEIRD_SERVER_REPLY,
        CURL_FTP_ACCESS_DENIED,
        CURL_OBSOLETE10,
        CURL_FTP_WEIRD_PASS_REPLY,
index 3190f803ba643cc8027b422ccccab1ed16372826..15647d3e719ca14f3916567be3ae914b5555a537 100644 (file)
@@ -19,7 +19,7 @@ In the broken scenario curl would use HTTP to talk to our FTP server. We handle
 that by replying with something that both protocols can understand. Our FTP
 server allows a custom welcome message, so we use that feature to make an HTTP
 reply that contains an FTP reply (think polyglot). In the case of FTP we expect
-curl will return CURLE_FTP_WEIRD_SERVER_REPLY so we test for that return code.
+curl will return CURLE_WEIRD_SERVER_REPLY so we test for that return code.
 -->
 <servercmd>
 REPLY welcome HTTP/1.1 200 OK\r\nContent-Length: 21\r\n\r\n500 Weird FTP Reply
@@ -46,7 +46,7 @@ Set the default protocol to ftp for a schemeless URL
 #
 # Verify data after the test has been "shot"
 <verify>
-# CURLE_FTP_WEIRD_SERVER_REPLY is error code 8
+# CURLE_WEIRD_SERVER_REPLY is error code 8
 <errorcode>
 8
 </errorcode>