2008-09-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

If an error occurred with a URI, remove identical URI from 
remaining
	URI list because it is likely that same error occurred in the 
end and it
	is waste of time.
	* src/AbstractCommand.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
pull/1/head
Tatsuhiro Tsujikawa 2008-09-03 12:12:47 +00:00
parent 09077b809f
commit d3453a8387
4 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2008-09-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
If an error occurred with a URI, remove identical URI from remaining
URI list because it is likely that same error occurred in the end and it
is waste of time.
* src/AbstractCommand.cc
* src/RequestGroup.cc
* src/RequestGroup.h
2008-09-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> 2008-09-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed wrong comment. Removed wrong comment.

View File

@ -213,6 +213,7 @@ void AbstractCommand::onAbort() {
if(!_requestGroup->getPieceStorage().isNull()) { if(!_requestGroup->getPieceStorage().isNull()) {
_requestGroup->getSegmentMan()->cancelSegment(cuid); _requestGroup->getSegmentMan()->cancelSegment(cuid);
} }
_requestGroup->removeIdenticalURI(req->getUrl());
} }
void AbstractCommand::disableReadCheckSocket() { void AbstractCommand::disableReadCheckSocket() {

View File

@ -960,6 +960,11 @@ void RequestGroup::removeURIWhoseHostnameIs(const std::string& hostname)
_uris = newURIs; _uris = newURIs;
} }
void RequestGroup::removeIdenticalURI(const std::string& uri)
{
_uris.erase(std::remove(_uris.begin(), _uris.end(), uri), _uris.end());
}
void RequestGroup::reportDownloadFinished() void RequestGroup::reportDownloadFinished()
{ {
_logger->notice(MSG_FILE_DOWNLOAD_COMPLETED, _logger->notice(MSG_FILE_DOWNLOAD_COMPLETED,

View File

@ -342,6 +342,8 @@ public:
void removeURIWhoseHostnameIs(const std::string& hostname); void removeURIWhoseHostnameIs(const std::string& hostname);
void removeIdenticalURI(const std::string& uri);
void reportDownloadFinished(); void reportDownloadFinished();
const std::deque<std::string>& getAcceptFeatures() const; const std::deque<std::string>& getAcceptFeatures() const;