1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

- All the quote options (CURLOPT_QUOTE, CURLOPT_POSTQUOTE and

CURLOPT_PREQUOTE) now accept a preceeding asterisk before the command to
  send when using FTP, as a sign that libcurl shall simply ignore the response
  from the server instead of treating it as an error. Not treating a 400+ FTP
  response code as an error means that failed commands will not abort the
  chain of commands, nor will they cause the connection to get disconnected.
This commit is contained in:
Daniel Stenberg 2009-07-27 18:36:56 +00:00
parent 9b5c00a664
commit 0684128209
3 changed files with 35 additions and 8 deletions

18
CHANGES
View File

@ -6,11 +6,21 @@
Changelog Changelog
Daniel Stenberg (27 Jul 2009)
- All the quote options (CURLOPT_QUOTE, CURLOPT_POSTQUOTE and
CURLOPT_PREQUOTE) now accept a preceeding asterisk before the command to
send when using FTP, as a sign that libcurl shall simply ignore the response
from the server instead of treating it as an error. Not treating a 400+ FTP
response code as an error means that failed commands will not abort the
chain of commands, nor will they cause the connection to get disconnected.
Daniel Stenberg (26 Jul 2009) Daniel Stenberg (26 Jul 2009)
- Bug report #2825989 (http://curl.haxx.se/bug/view.cgi?id=2825989) pointed - Johan van Selst posted bug report #2825989
out that OpenSSL-powered libcurl didn't support the SHA-2 digest algorithm, (http://curl.haxx.se/bug/view.cgi?id=2825989) pointing out that
and provided the solution too: to use OpenSSL_add_all_algorithms() instead OpenSSL-powered libcurl didn't support the SHA-2 digest algorithm, and
of the older SSLeay_* alternative. provided the solution too: to use OpenSSL_add_all_algorithms() in addition
to the older SSLeay_* alternative. OpenSSL_add_all_algorithms was added in
OpenSSL 0.9.5
Daniel Stenberg (23 Jul 2009) Daniel Stenberg (23 Jul 2009)
- Added CURLOPT_SSH_KNOWNHOSTS, CURLOPT_SSH_KEYFUNCTION, CURLOPT_SSH_KEYDATA. - Added CURLOPT_SSH_KNOWNHOSTS, CURLOPT_SSH_KEYFUNCTION, CURLOPT_SSH_KEYDATA.

View File

@ -11,6 +11,8 @@ This release includes the following changes:
o CURLOPT_FTPPORT (and curl's -P/--ftpport) support port ranges o CURLOPT_FTPPORT (and curl's -P/--ftpport) support port ranges
o Added CURLOPT_SSH_KNOWNHOSTS, CURLOPT_SSH_KEYFUNCTION, CURLOPT_SSH_KEYDATA o Added CURLOPT_SSH_KNOWNHOSTS, CURLOPT_SSH_KEYFUNCTION, CURLOPT_SSH_KEYDATA
o CURLOPT_QUOTE, CURLOPT_POSTQUOTE and CURLOPT_PREQUOTE can be told to ignore
error responses when used with FTP
This release includes the following bugfixes: This release includes the following bugfixes:
@ -48,6 +50,6 @@ advice from friends like these:
Andre Guibert de Bruet, Mike Crowe, Claes Jakobsson, John E. Malmberg, Andre Guibert de Bruet, Mike Crowe, Claes Jakobsson, John E. Malmberg,
Aaron Oneal, Igor Novoseltsev, Eric Wong, Bill Hoffman, Daniel Steinberg, Aaron Oneal, Igor Novoseltsev, Eric Wong, Bill Hoffman, Daniel Steinberg,
Fabian Keil, Michal Marek, Reuven Wachtfogel, Markus Koetter, Fabian Keil, Michal Marek, Reuven Wachtfogel, Markus Koetter,
Constantine Sapuntzakis, David Binderman Constantine Sapuntzakis, David Binderman, Johan van Selst
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)

View File

@ -3323,6 +3323,8 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
* *
* Where a 'quote' means a list of custom commands to send to the server. * Where a 'quote' means a list of custom commands to send to the server.
* The quote list is passed as an argument. * The quote list is passed as an argument.
*
* BLOCKING
*/ */
static static
@ -3336,14 +3338,27 @@ CURLcode ftp_sendquote(struct connectdata *conn, struct curl_slist *quote)
item = quote; item = quote;
while(item) { while(item) {
if(item->data) { if(item->data) {
FTPSENDF(conn, "%s", item->data); char *cmd = item->data;
bool acceptfail = FALSE;
/* if a command starts with an asterisk, which a legal FTP command never
can, the command will be allowed to fail without it causing any
aborts or cancels etc. It will cause libcurl to act as if the command
is successful, whatever the server reponds. */
if(cmd[0] == '*') {
cmd++;
acceptfail = TRUE;
}
FTPSENDF(conn, "%s", cmd);
result = Curl_GetFTPResponse(&nread, conn, &ftpcode); result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
if(result) if(result)
return result; return result;
if(ftpcode >= 400) { if(!acceptfail && (ftpcode >= 400)) {
failf(conn->data, "QUOT string not accepted: %s", item->data); failf(conn->data, "QUOT string not accepted: %s", cmd);
return CURLE_QUOTE_ERROR; return CURLE_QUOTE_ERROR;
} }
} }