diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-10-31 22:43:05 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-10-31 22:43:05 +0900 |
| commit | 57b37db8a115ab32ce7308bf324773cae59a0db0 (patch) | |
| tree | 8b2d0ee36826f6afc9e520ee73e2e89069307f8d /src/RpcMethodImpl.cc | |
| parent | 9e2624a265066a7bfbb775630d4688cecae85f1e (diff) | |
--max-connection-per-server option is now available in aria2.changeOption.
--max-connection-per-server option is now available in
aria2.changeOption if a download is waiting/paused in queue.
Diffstat (limited to 'src/RpcMethodImpl.cc')
| -rw-r--r-- | src/RpcMethodImpl.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/RpcMethodImpl.cc b/src/RpcMethodImpl.cc index 8f31ae3a..b5ba8aea 100644 --- a/src/RpcMethodImpl.cc +++ b/src/RpcMethodImpl.cc @@ -1137,6 +1137,14 @@ void changeOption if(option.defined(PREF_SPLIT)) { group->setNumConcurrentCommand(option.getAsInt(PREF_SPLIT)); } + if(option.defined(PREF_MAX_CONNECTION_PER_SERVER)) { + int maxConn = option.getAsInt(PREF_MAX_CONNECTION_PER_SERVER); + const std::vector<SharedHandle<FileEntry> >& files = dctx->getFileEntries(); + for(std::vector<SharedHandle<FileEntry> >::const_iterator i = files.begin(), + eoi = files.end(); i != eoi; ++i) { + (*i)->setMaxConnectionPerServer(maxConn); + } + } if(option.defined(PREF_MAX_DOWNLOAD_LIMIT)) { group->setMaxDownloadSpeedLimit (option.getAsInt(PREF_MAX_DOWNLOAD_LIMIT)); |
