Kaynağa Gözat

2007-10-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

	Fixed the bug:
	aria2c always fails when downloading a file whose name contains 
a
	space in FTP
	* src/FtpConnection.cc: URL-decode dir and path.
Tatsuhiro Tsujikawa 18 yıl önce
ebeveyn
işleme
ff48925807
2 değiştirilmiş dosya ile 10 ekleme ve 3 silme
  1. 7 0
      ChangeLog
  2. 3 3
      src/FtpConnection.cc

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2007-10-10  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
+
+	Fixed the bug:
+	aria2c always fails when downloading a file whose name contains a
+	space in FTP
+	* src/FtpConnection.cc: URL-decode dir and path.
+
 2007-10-06  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 
 	* test/FileTest.cc: Included fstream.

+ 3 - 3
src/FtpConnection.cc

@@ -73,13 +73,13 @@ void FtpConnection::sendType() const {
 }
 
 void FtpConnection::sendCwd() const {
-  string request = "CWD "+req->getDir()+"\r\n";
+  string request = "CWD "+Util::urldecode(req->getDir())+"\r\n";
   logger->info(MSG_SENDING_REQUEST, cuid, request.c_str());
   socket->writeData(request);
 }
 
 void FtpConnection::sendSize() const {
-  string request = "SIZE "+req->getFile()+"\r\n";
+  string request = "SIZE "+Util::urldecode(req->getFile())+"\r\n";
   logger->info(MSG_SENDING_REQUEST, cuid, request.c_str());
   socket->writeData(request);
 }
@@ -116,7 +116,7 @@ void FtpConnection::sendRest(const SegmentHandle& segment) const {
 }
 
 void FtpConnection::sendRetr() const {
-  string request = "RETR "+req->getFile()+"\r\n";
+  string request = "RETR "+Util::urldecode(req->getFile())+"\r\n";
   logger->info(MSG_SENDING_REQUEST, cuid, request.c_str());
   socket->writeData(request);
 }