summaryrefslogtreecommitdiffstats
path: root/net/ftp/ftp_network_transaction.h
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-24 21:46:50 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-24 21:46:50 +0000
commitb1c7cc42d026a073d1db2e7fa293be525e936738 (patch)
treeff24b7ee9676f5b6ab1f49106bddd329ef3da7e2 /net/ftp/ftp_network_transaction.h
parent63cdfb96a08d384963ee792c4a6687009b0dc10b (diff)
downloadchromium_src-b1c7cc42d026a073d1db2e7fa293be525e936738.zip
chromium_src-b1c7cc42d026a073d1db2e7fa293be525e936738.tar.gz
chromium_src-b1c7cc42d026a073d1db2e7fa293be525e936738.tar.bz2
Correctly talk to VMS servers (translate UNIX paths to VMS and vice versa).
This way we get a native VMS listing and not a UNIX emulation mode, which is slightly different than native UNIX and confuses the parser. TEST=Covered by net_unittests. BUG=22193 Review URL: http://codereview.chromium.org/215058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27129 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ftp/ftp_network_transaction.h')
-rw-r--r--net/ftp/ftp_network_transaction.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/net/ftp/ftp_network_transaction.h b/net/ftp/ftp_network_transaction.h
index 3366c71..e621a9b 100644
--- a/net/ftp/ftp_network_transaction.h
+++ b/net/ftp/ftp_network_transaction.h
@@ -85,6 +85,15 @@ class FtpNetworkTransaction : public FtpTransaction {
ERROR_CLASS_PERMANENT_ERROR,
};
+ // Major categories of remote system types, as returned by SYST command.
+ enum SystemType {
+ SYSTEM_TYPE_UNKNOWN,
+ SYSTEM_TYPE_UNIX,
+ SYSTEM_TYPE_WINDOWS,
+ SYSTEM_TYPE_OS2,
+ SYSTEM_TYPE_VMS,
+ };
+
// Resets the members of the transaction so it can be restarted.
void ResetStateForRestart();
@@ -101,8 +110,9 @@ class FtpNetworkTransaction : public FtpTransaction {
// code to be in range 100-599.
static ErrorClass GetErrorClass(int response_code);
- // Returns request path suitable to be included in an FTP command.
- std::string GetRequestPathForFtpCommand() const;
+ // Returns request path suitable to be included in an FTP command. If the path
+ // will be used as a directory, |is_directory| should be true.
+ std::string GetRequestPathForFtpCommand(bool is_directory) const;
// Runs the state transition loop.
int DoLoop(int result);
@@ -190,11 +200,17 @@ class FtpNetworkTransaction : public FtpTransaction {
int last_error_;
+ SystemType system_type_;
+
// We get username and password as wstrings in RestartWithAuth, so they are
// also kept as wstrings here.
std::wstring username_;
std::wstring password_;
+ // Current directory on the remote server, as returned by last PWD command,
+ // with any trailing slash removed.
+ std::string current_remote_directory_;
+
bool retr_failed_;
int data_connection_port_;