From b0f180c99c83be511b32c2a22e4e7d701c69a3d9 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 7 Mar 2010 10:36:42 +0000 Subject: [PATCH] 2010-03-07 Tatsuhiro Tsujikawa url -> uri in Request class. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/DefaultBtAnnounce.cc * src/FeedbackURISelector.cc * src/FileEntry.cc * src/FileEntry.h * src/HttpRequest.h * src/HttpResponse.cc * src/InitiateConnectionCommandFactory.cc * src/Metalink2RequestGroup.cc * src/OptionHandlerImpl.h * src/ProtocolDetector.cc * src/Request.cc * src/Request.h * src/XmlRpcMethodImpl.cc * test/AuthConfigFactoryTest.cc * test/FtpConnectionTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc * test/RequestTest.cc --- ChangeLog | 24 ++ src/AbstractCommand.cc | 32 +-- src/AdaptiveURISelector.cc | 2 +- src/DefaultBtAnnounce.cc | 58 ++-- src/FeedbackURISelector.cc | 4 +- src/FileEntry.cc | 6 +- src/FileEntry.h | 4 +- src/HttpRequest.h | 6 +- src/HttpResponse.cc | 6 +- src/InitiateConnectionCommandFactory.cc | 4 +- src/Metalink2RequestGroup.cc | 18 +- src/OptionHandlerImpl.h | 10 +- src/ProtocolDetector.cc | 2 +- src/Request.cc | 66 ++--- src/Request.h | 32 +-- src/XmlRpcMethodImpl.cc | 4 +- test/AuthConfigFactoryTest.cc | 32 +-- test/FtpConnectionTest.cc | 2 +- test/HttpRequestTest.cc | 50 ++-- test/HttpResponseTest.cc | 16 +- test/RequestTest.cc | 342 ++++++++++++------------ 21 files changed, 372 insertions(+), 348 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e01ea49..e72eba8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2010-03-07 Tatsuhiro Tsujikawa + + url -> uri in Request class. + * src/AbstractCommand.cc + * src/AdaptiveURISelector.cc + * src/DefaultBtAnnounce.cc + * src/FeedbackURISelector.cc + * src/FileEntry.cc + * src/FileEntry.h + * src/HttpRequest.h + * src/HttpResponse.cc + * src/InitiateConnectionCommandFactory.cc + * src/Metalink2RequestGroup.cc + * src/OptionHandlerImpl.h + * src/ProtocolDetector.cc + * src/Request.cc + * src/Request.h + * src/XmlRpcMethodImpl.cc + * test/AuthConfigFactoryTest.cc + * test/FtpConnectionTest.cc + * test/HttpRequestTest.cc + * test/HttpResponseTest.cc + * test/RequestTest.cc + 2010-03-07 Tatsuhiro Tsujikawa Added getServers XML-RPC method. diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc index 9678ac68..05f491cb 100644 --- a/src/AbstractCommand.cc +++ b/src/AbstractCommand.cc @@ -111,7 +111,7 @@ bool AbstractCommand::execute() { if(logger->debug()) { logger->debug ("CUID#%d - Discard original URI=%s because it is requested.", - cuid, req->getUrl().c_str()); + cuid, req->getUri().c_str()); } return prepareForRetry(0); } @@ -208,10 +208,10 @@ bool AbstractCommand::execute() { } else { logger->error(MSG_DOWNLOAD_ABORTED, DL_ABORT_EX2(StringFormat - ("URI=%s", req->getCurrentUrl().c_str()).str(),err), - cuid, req->getUrl().c_str()); - _fileEntry->addURIResult(req->getUrl(), err.getCode()); - _requestGroup->setLastUriResult(req->getUrl(), err.getCode()); + ("URI=%s", req->getCurrentUri().c_str()).str(),err), + cuid, req->getUri().c_str()); + _fileEntry->addURIResult(req->getUri(), err.getCode()); + _requestGroup->setLastUriResult(req->getUri(), err.getCode()); } onAbort(); tryReserved(); @@ -220,8 +220,8 @@ bool AbstractCommand::execute() { assert(!req.isNull()); logger->info(MSG_RESTARTING_DOWNLOAD, DL_RETRY_EX2(StringFormat - ("URI=%s", req->getCurrentUrl().c_str()).str(),err), - cuid, req->getUrl().c_str()); + ("URI=%s", req->getCurrentUri().c_str()).str(),err), + cuid, req->getUri().c_str()); req->addTryCount(); req->resetRedirectCount(); const unsigned int maxTries = getOption()->getAsInt(PREF_MAX_TRIES); @@ -229,9 +229,9 @@ bool AbstractCommand::execute() { if(isAbort) { onAbort(); logger->info(MSG_MAX_TRY, cuid, req->getTryCount()); - logger->error(MSG_DOWNLOAD_ABORTED, err, cuid, req->getUrl().c_str()); - _fileEntry->addURIResult(req->getUrl(), err.getCode()); - _requestGroup->setLastUriResult(req->getUrl(), err.getCode()); + logger->error(MSG_DOWNLOAD_ABORTED, err, cuid, req->getUri().c_str()); + _fileEntry->addURIResult(req->getUri(), err.getCode()); + _requestGroup->setLastUriResult(req->getUri(), err.getCode()); tryReserved(); return true; } else { @@ -240,8 +240,8 @@ bool AbstractCommand::execute() { } catch(DownloadFailureException& err) { logger->error(EX_EXCEPTION_CAUGHT, err); if(!req.isNull()) { - _fileEntry->addURIResult(req->getUrl(), err.getCode()); - _requestGroup->setLastUriResult(req->getUrl(), err.getCode()); + _fileEntry->addURIResult(req->getUri(), err.getCode()); + _requestGroup->setLastUriResult(req->getUri(), err.getCode()); } _requestGroup->setHaltRequested(true); return true; @@ -281,7 +281,7 @@ bool AbstractCommand::prepareForRetry(time_t wait) { _fileEntry->poolRequest(req); if(logger->debug()) { logger->debug("CUID#%d - Pooling request URI=%s", - cuid, req->getUrl().c_str()); + cuid, req->getUri().c_str()); } if(!_requestGroup->getSegmentMan().isNull()) { _requestGroup->getSegmentMan()->recognizeSegmentFor(_fileEntry); @@ -305,7 +305,7 @@ void AbstractCommand::onAbort() { // TODO This might be a problem if the failure is caused by proxy. e->_requestGroupMan->getOrCreateServerStat(req->getHost(), req->getProtocol())->setError(); - _fileEntry->removeIdenticalURI(req->getUrl()); + _fileEntry->removeIdenticalURI(req->getUri()); _fileEntry->removeRequest(req); } if(logger->debug()) { @@ -421,7 +421,7 @@ static bool isProxyRequest (const std::string& protocol, const SharedHandle