* Switch the order rak::advance_bidirectional iterates.

* When testing for mincore, cast the address pointer to (char*).

* Failure during syncing causes the download to stop, unless
flag_ignore_error is set.

* Trigger storage error signal for HashTorrent in
DownloadWrapper::receive_initial_hash.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@774 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-09-10 03:28:09 +00:00
parent b90a220e15
commit 407824c9c8
2 changed files with 13 additions and 21 deletions
+11 -19
View File
@@ -56,15 +56,6 @@ for_each_pre(_InputIter __first, _InputIter __last, _Function __f) {
return __f;
}
template <typename InputIter, typename Function, typename Accumulator>
Accumulator
accumulate(InputIter first, InputIter last, Function function, Accumulator acc) {
while (first != last)
acc += function(*first++);
return acc;
}
// Return a range with a distance of no more than __distance and
// between __first and __last, centered on __middle1.
template <typename _InputIter, typename _Distance>
@@ -73,6 +64,17 @@ advance_bidirectional(_InputIter __first, _InputIter __middle1, _InputIter __las
_InputIter __middle2 = __middle1;
do {
if (!__distance)
break;
if (__middle2 != __last) {
++__middle2;
--__distance;
} else if (__middle1 == __first) {
break;
}
if (!__distance)
break;
@@ -84,16 +86,6 @@ advance_bidirectional(_InputIter __first, _InputIter __middle1, _InputIter __las
break;
}
if (!__distance)
break;
if (__middle2 != __last) {
++__middle2;
--__distance;
} else if (__middle1 == __first) {
break;
}
} while (true);
return std::make_pair(__middle1, __middle2);