mirror of https://github.com/aria2/aria2
				
				
				
			2008-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Pool connection when CWD, SIZE command fails. * src/FtpNegotiationCommand.cc * src/FtpNegotiationCommand.hpull/1/head
							parent
							
								
									10b1ddd2c0
								
							
						
					
					
						commit
						e71b09a9dc
					
				|  | @ -1,3 +1,9 @@ | |||
| 2008-05-10  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com> | ||||
| 
 | ||||
| 	Pool connection when CWD, SIZE command fails. | ||||
| 	* src/FtpNegotiationCommand.cc | ||||
| 	* src/FtpNegotiationCommand.h | ||||
| 
 | ||||
| 2008-05-10  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com> | ||||
| 
 | ||||
| 	Renamed HttpNullDownloadCommand as HttpSkipResponseCommand | ||||
|  |  | |||
|  | @ -193,6 +193,7 @@ bool FtpNegotiationCommand::recvCwd() { | |||
|     return false; | ||||
|   } | ||||
|   if(status != 250) { | ||||
|     poolConnection(); | ||||
|     throw DlAbortEx(StringFormat(EX_BAD_STATUS, status).str()); | ||||
|   } | ||||
|   sequence = SEQ_SEND_SIZE; | ||||
|  | @ -212,6 +213,7 @@ bool FtpNegotiationCommand::recvSize() { | |||
|     return false; | ||||
|   } | ||||
|   if(status != 213) { | ||||
|     poolConnection(); | ||||
|     throw DlAbortEx(StringFormat(EX_BAD_STATUS, status).str()); | ||||
|   } | ||||
|   if(size > INT64_MAX) { | ||||
|  | @ -241,10 +243,8 @@ bool FtpNegotiationCommand::recvSize() { | |||
|     BtProgressInfoFileHandle infoFile(new DefaultBtProgressInfoFile(_requestGroup->getDownloadContext(), _requestGroup->getPieceStorage(), e->option)); | ||||
|     if(!infoFile->exists() && _requestGroup->downloadFinishedByFileLength()) { | ||||
|       sequence = SEQ_DOWNLOAD_ALREADY_COMPLETED; | ||||
|       // We can pool socket here
 | ||||
|       std::pair<std::string, uint16_t> peerInfo; | ||||
|       socket->getPeerInfo(peerInfo); | ||||
|       e->poolSocket(peerInfo.first, peerInfo.second, socket); | ||||
| 
 | ||||
|       poolConnection(); | ||||
| 
 | ||||
|       return false; | ||||
|     } | ||||
|  | @ -436,4 +436,13 @@ bool FtpNegotiationCommand::processSequence(const SegmentHandle& segment) { | |||
|   return doNextSequence; | ||||
| } | ||||
| 
 | ||||
| void FtpNegotiationCommand::poolConnection() const | ||||
| { | ||||
|   if(e->option->getAsBool(PREF_FTP_REUSE_CONNECTION)) { | ||||
|     std::pair<std::string, uint16_t> peerInfo; | ||||
|     socket->getPeerInfo(peerInfo); | ||||
|     e->poolSocket(peerInfo.first, peerInfo.second, socket); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| } // namespace aria2
 | ||||
|  |  | |||
|  | @ -98,6 +98,8 @@ private: | |||
| 
 | ||||
|   void afterFileAllocation(); | ||||
| 
 | ||||
|   void poolConnection() const; | ||||
| 
 | ||||
|   SharedHandle<SocketCore> dataSocket; | ||||
|   SharedHandle<SocketCore> serverSocket; | ||||
|   Seq sequence; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Tatsuhiro Tsujikawa
						Tatsuhiro Tsujikawa