diff options
author | Jay Freeman <saurik@saurik.com> | 2009-01-21 11:17:34 +0000 |
---|---|---|
committer | Jay Freeman <saurik@saurik.com> | 2009-01-21 11:17:34 +0000 |
commit | a0ae11d92d5174c55556b471b5037337f1e8cc9c (patch) | |
tree | 07f3a8a827273983c84a9d9850563cd08e9f5752 /data/apt/parallel.diff | |
parent | f9ed7a931918564e2ec52259a0999c93ee8d476f (diff) |
Fixed Dl-Limit (long standing APT bug that they won't acknowledge), specified error messages for HTTP status codes, and added support for download timeouts.
git-svn-id: http://svn.telesphoreo.org/trunk@534 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'data/apt/parallel.diff')
-rw-r--r-- | data/apt/parallel.diff | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/data/apt/parallel.diff b/data/apt/parallel.diff new file mode 100644 index 000000000..1643fd2c7 --- /dev/null +++ b/data/apt/parallel.diff @@ -0,0 +1,33 @@ +diff -ru apt-0.6.46.4.1/apt-pkg/acquire.cc apt-0.6.46.4.1+iPhone/apt-pkg/acquire.cc +--- apt-0.6.46.4.1/apt-pkg/acquire.cc 2006-12-04 14:37:34.000000000 +0000 ++++ apt-0.6.46.4.1+iPhone/apt-pkg/acquire.cc 2009-01-21 10:47:16.000000000 +0000 +@@ -238,9 +238,27 @@ + /* Single-Instance methods get exactly one queue per URI. This is + also used for the Access queue method */ + if (Config->SingleInstance == true || QueueMode == QueueAccess) +- return U.Access; ++ return U.Access; ++ string name(U.Access + ':' + U.Host); + +- return U.Access + ':' + U.Host; ++ int parallel(_config->FindI("Acquire::"+U.Access+"::MaxParallel",0)); ++ if (parallel <= 0) ++ return name; ++ ++ typedef map<string, int> indexmap; ++ static indexmap indices; ++ ++ pair<indexmap::iterator, bool> cache(indices.insert(indexmap::value_type(name, -1))); ++ if (cache.second || cache.first->second == -1) { ++ int &index(indices[U.Access]); ++ if (index >= parallel) ++ index = 0; ++ cache.first->second = index++; ++ } ++ ++ ostringstream value; ++ value << U.Access << "::" << cache.first->second; ++ return value.str(); + } + /*}}}*/ + // Acquire::GetConfig - Fetch the configuration information /*{{{*/ |