diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-07-09 11:48:59 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-07-09 11:48:59 +0000 |
| commit | f285f66ac8a95f175aaedf16783bb62f9821a8fc (patch) | |
| tree | 89e4a07ba7107bcc453c4e0bdbd1de1b50b6b102 /src/FtpConnection.cc | |
| parent | be423e2c77bba5a88013e285925034a08d31bfc7 (diff) | |
2010-07-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Send each CWD component of FTP URI in separate CWD command as
described in RFC1738.
* src/FtpConnection.cc
* src/FtpConnection.h
* src/FtpInitiateConnectionCommand.cc
* src/FtpNegotiationCommand.cc
* src/FtpNegotiationCommand.h
* test/FtpConnectionTest.cc
Diffstat (limited to 'src/FtpConnection.cc')
| -rw-r--r-- | src/FtpConnection.cc | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc index 0aaa9a4a..8a54f935 100644 --- a/src/FtpConnection.cc +++ b/src/FtpConnection.cc @@ -142,22 +142,11 @@ bool FtpConnection::sendPwd() return socketBuffer_.sendBufferIsEmpty(); } -bool FtpConnection::sendCwd() +bool FtpConnection::sendCwd(const std::string& dir) { if(socketBuffer_.sendBufferIsEmpty()) { - if(logger_->info()) { - logger_->info("CUID#%s - Using base working directory '%s'", - util::itos(cuid_).c_str(), baseWorkingDir_.c_str()); - } std::string request = "CWD "; - if(util::startsWith(util::toUpper(req_->getDir()), "/%2F")) { - request += util::percentDecode(req_->getDir().substr(1)); - } else { - if(baseWorkingDir_ != "/") { - request += baseWorkingDir_; - } - request += util::percentDecode(req_->getDir()); - } + request += util::percentDecode(dir); request += "\r\n"; if(logger_->info()) { logger_->info(MSG_SENDING_REQUEST, |
