2008-07-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Fixed the bug that causes infinite loop when the number of 
pieces are
	fewer than allowed fast set size which is 10 by default.
	* src/DefaultBtContext.cc
pull/1/head
Tatsuhiro Tsujikawa 2008-07-12 07:25:10 +00:00
parent 10f730cfec
commit 8929168380
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-07-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that causes infinite loop when the number of pieces are
fewer than allowed fast set size which is 10 by default.
* src/DefaultBtContext.cc
2008-07-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated the descriptions for -j, -s. Added --bt-seed.

View File

@ -422,6 +422,9 @@ void DefaultBtContext::computeFastSet
if(!PeerMessageUtil::createcompact(compact, ipaddr, 0)) {
return;
}
if(numPieces < fastSetSize) {
fastSetSize = numPieces;
}
unsigned char tx[24];
memcpy(tx, compact, 4);
if((tx[0] & 0x80) == 0 || (tx[0] & 0x40) == 0) {