Changelog
+Daniel Stenberg (9 Apr 2010)
+- Prefixing the FTP quote commands with an asterisk really only worked for the
+ postquote actions. This is now fixed and test case 227 has been extended to
+ verify.
+
Kamil Dudka (4 Apr 2010)
- Eliminated a race condition in Curl_resolv_timeout().
o RTSP GET_PARAMETER
o timeout after last data chunk was handled
o SFTP download hang
+ o FTP quote commands prefixed with '*' now can fail without aborting
This release includes the following known bugs:
break;
}
+ /*
+ * This state uses:
+ * 'count1' to iterate over the commands to send
+ * 'count2' to store wether to allow commands to fail
+ */
+
if(init)
ftpc->count1 = 0;
else
i++;
}
if(item) {
- PPSENDF(&ftpc->pp, "%s", item->data);
+ char *cmd = item->data;
+ if(cmd[0] == '*') {
+ cmd++;
+ ftpc->count2 = 1; /* the sent command is allowed to fail */
+ }
+ else
+ ftpc->count2 = 0; /* failure means cancel operation */
+
+ PPSENDF(&ftpc->pp, "%s", cmd);
state(conn, instate);
quote = TRUE;
}
case FTP_POSTQUOTE:
case FTP_RETR_PREQUOTE:
case FTP_STOR_PREQUOTE:
- if(ftpcode >= 400) {
+ if((ftpcode >= 400) && !ftpc->count2) {
+ /* failure reponse code, and not allowed to fail */
failf(conn->data, "QUOT command failed with %03d", ftpcode);
return CURLE_QUOTE_ERROR;
}
</data>
<servercmd>
REPLY EPSV 500 no such command
+REPLY FAIL 500 this might not be a failure!
</servercmd>
</reply>
FTP with quote ops
</name>
<command>
-ftp://%HOSTIP:%FTPPORT/227 -Q "NOOP 1" -Q "+NOOP 2" -Q "-NOOP 3"
+ftp://%HOSTIP:%FTPPORT/227 -Q "NOOP 1" -Q "+NOOP 2" -Q "-NOOP 3" -Q "*FAIL" -Q "+*FAIL HARD"
</command>
</client>
PASS ftp@example.com\r
PWD\r
NOOP 1\r
+FAIL\r
EPSV\r
PASV\r
TYPE I\r
NOOP 2\r
+FAIL HARD\r
SIZE 227\r
RETR 227\r
NOOP 3\r