diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-06-09 12:43:44 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-06-09 12:43:44 +0000 |
| commit | 970e7f95a65b1b8940c9131a76372b7d7abffdf1 (patch) | |
| tree | c3a9b7b51a97a01160a7b37989406b78041d9115 /src/InitiateConnectionCommand.cc | |
| parent | 9afc36152a1ce428243a3ace608d0508716a2efb (diff) | |
2010-06-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made protected member variable private. Added accessor funcs.
* src/AbstractCommand.cc
* src/AbstractCommand.h
* src/AbstractProxyRequestCommand.cc
* src/AbstractProxyRequestCommand.h
* src/AbstractProxyResponseCommand.cc
* src/AbstractProxyResponseCommand.h
* src/CreateRequestCommand.cc
* src/DownloadCommand.cc
* src/DownloadCommand.h
* src/FtpDownloadCommand.cc
* src/FtpDownloadCommand.h
* src/FtpFinishDownloadCommand.cc
* src/FtpInitiateConnectionCommand.cc
* src/FtpNegotiationCommand.cc
* src/FtpNegotiationCommand.h
* src/FtpTunnelRequestCommand.cc
* src/FtpTunnelResponseCommand.cc
* src/HttpDownloadCommand.cc
* src/HttpInitiateConnectionCommand.cc
* src/HttpProxyRequestCommand.cc
* src/HttpProxyResponseCommand.cc
* src/HttpRequestCommand.cc
* src/HttpResponseCommand.cc
* src/HttpResponseCommand.h
* src/HttpSkipResponseCommand.cc
* src/InitiateConnectionCommand.cc
Diffstat (limited to 'src/InitiateConnectionCommand.cc')
| -rw-r--r-- | src/InitiateConnectionCommand.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/InitiateConnectionCommand.cc b/src/InitiateConnectionCommand.cc index 6ef9e9c2..8b57e18e 100644 --- a/src/InitiateConnectionCommand.cc +++ b/src/InitiateConnectionCommand.cc @@ -77,8 +77,8 @@ bool InitiateConnectionCommand::executeInternal() { uint16_t port; SharedHandle<Request> proxyRequest = createProxyRequest(); if(proxyRequest.isNull()) { - hostname = req->getHost(); - port = req->getPort(); + hostname = getRequest()->getHost(); + port = getRequest()->getPort(); } else { hostname = proxyRequest->getHost(); port = proxyRequest->getPort(); @@ -86,21 +86,21 @@ bool InitiateConnectionCommand::executeInternal() { std::vector<std::string> addrs; std::string ipaddr = resolveHostname(addrs, hostname, port); if(ipaddr.empty()) { - e->addCommand(this); + getDownloadEngine()->addCommand(this); return false; } try { Command* command = createNextCommand(hostname, ipaddr, port, addrs, proxyRequest); - e->addCommand(command); + getDownloadEngine()->addCommand(command); return true; } catch(RecoverableException& ex) { // Catch exception and retry another address. // See also AbstractCommand::checkIfConnectionEstablished // TODO ipaddr might not be used if pooled sockt was found. - e->markBadIPAddress(hostname, ipaddr, port); - if(!e->findCachedIPAddress(hostname, port).empty()) { + getDownloadEngine()->markBadIPAddress(hostname, ipaddr, port); + if(!getDownloadEngine()->findCachedIPAddress(hostname, port).empty()) { if(getLogger()->info()) { getLogger()->info(EX_EXCEPTION_CAUGHT, ex); getLogger()->info(MSG_CONNECT_FAILED_AND_RETRY, @@ -108,12 +108,13 @@ bool InitiateConnectionCommand::executeInternal() { } Command* command = InitiateConnectionCommandFactory::createInitiateConnectionCommand - (getCuid(), req, _fileEntry, _requestGroup, e); - e->setNoWait(true); - e->addCommand(command); + (getCuid(), getRequest(), getFileEntry(), getRequestGroup(), + getDownloadEngine()); + getDownloadEngine()->setNoWait(true); + getDownloadEngine()->addCommand(command); return true; } - e->removeCachedIPAddress(hostname, port); + getDownloadEngine()->removeCachedIPAddress(hostname, port); throw; } } |
