summaryrefslogtreecommitdiff
path: root/src/FileEntry.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-07-15 13:49:02 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-07-15 13:49:02 +0000
commit55d98cff0b5e19844ff6a70ee3d8d1b061a0e146 (patch)
tree4c63b396b08f3e5bc70eba6220b0a889cb4cddf6 /src/FileEntry.cc
parent1984c2a5425709905ab1fe6dc2b4ca8fe5688bc9 (diff)
2010-07-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
FeedbackURISelector now tries to select URI whose host is least used in aria2 globally. Reverted the previous change. * src/AdaptiveURISelector.cc * src/AdaptiveURISelector.h * src/CreateRequestCommand.cc * src/FeedbackURISelector.cc * src/FeedbackURISelector.h * src/FileEntry.cc * src/FileEntry.h * src/InOrderURISelector.cc * src/InOrderURISelector.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/URISelector.h * src/a2algo.h * test/FeedbackURISelectorTest.cc * test/InOrderURISelectorTest.cc
Diffstat (limited to 'src/FileEntry.cc')
-rw-r--r--src/FileEntry.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/FileEntry.cc b/src/FileEntry.cc
index b6b8f925..982c6643 100644
--- a/src/FileEntry.cc
+++ b/src/FileEntry.cc
@@ -41,6 +41,7 @@
#include "URISelector.h"
#include "LogFactory.h"
#include "wallclock.h"
+#include "a2algo.h"
namespace aria2 {
@@ -121,7 +122,7 @@ SharedHandle<Request>
FileEntry::getRequest
(const SharedHandle<URISelector>& selector,
bool uriReuse,
- const std::vector<std::string>& usedHosts,
+ const std::vector<std::pair<size_t, std::string> >& usedHosts,
const std::string& referer,
const std::string& method)
{
@@ -131,7 +132,7 @@ FileEntry::getRequest
for(std::deque<SharedHandle<Request> >::iterator i = requestPool_.begin(),
eoi = requestPool_.end(); i != eoi; ++i) {
r.setUri((*i)->getUri());
- if(std::find(usedHosts.begin(), usedHosts.end(), r.getHost()) !=
+ if(findSecond(usedHosts.begin(), usedHosts.end(), r.getHost()) !=
usedHosts.end()) {
continue;
}