Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/curl.1
Original file line number Diff line number Diff line change
Expand Up @@ -2252,7 +2252,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
Expand Down
5 changes: 2 additions & 3 deletions docs/libcurl/libcurl-errors.3
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions docs/libcurl/symbols-in-versions
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion include/curl/curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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. */
Expand Down
8 changes: 4 additions & 4 deletions lib/imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/pop3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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? */
Expand Down
2 changes: 1 addition & 1 deletion lib/smtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions lib/strerror.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 2 additions & 0 deletions packages/OS400/curl.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@
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...
Expand Down
3 changes: 2 additions & 1 deletion packages/vms/curlmsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/vms/curlmsg.msg
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions packages/vms/curlmsg.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
2 changes: 1 addition & 1 deletion packages/vms/curlmsg_vms.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions tests/data/test2045
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>
Expand Down