// Only stream mode is supported.
// No EBCDIC support.
//
+#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacErrors.h>
+
#include "ftp-protocol.h"
#include "netparameters.h"
-
namespace Security {
namespace Network {
printfe("RMD %s", mOperationPath.c_str());
state = directCommandSent;
return;
+ case removeFile:
+ printfe("DELE %s", mOperationPath.c_str());
+ state = directCommandSent;
+ return;
case genericCommand:
printfe("%s", mOperationPath.c_str());
state = directCommandSent;
case transferSent:
switch (reply) {
case 150:
+ case 125:
+ transfer().ftpResponse() = input; // remember response for caller.
+ transfer().ftpResponseCode() = reply;
if (!mPassive)
mReceiver.receive(mDataPath); // accept incoming connection and stop listening
+ observe(Observer::resultCodeReady, input);
// engage the data path
switch (operation()) {
case downloadDirectory:
case downloadListing:
mDataPath.start(sink());
+ observe(Observer::downloading, input);
break;
case upload:
mDataPath.start(source());
+ observe(Observer::uploading, input);
break;
default:
assert(false);
mDataPath.connectionDone();
break;
case 452:
- fail(input, ENOSPC);
+ mDataPath.close();
+ state = idle;
+ fail(input, dskFulErr);
break;
default: // transfer failed
// (ignore any error in mDataPath - prefer diagnostics from remote)
void FTPProtocol::FTPTransfer::abort()
{
+ observe(Observer::aborting);
setError("aborted");
connectionAs<FTPConnection>().abort();
}
InetReply reply(errorDescription().c_str());
if (reply / 10 == 53) // 53x - authentication failure
return authorizationFailure;
- // when in doubt, blame the remote
+ if (errorDescription() == "aborted")
+ return abortedFailure;
+ // when in doubt, blame the remote
return remoteFailure;
}
case finished: