2008-09-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Moved `TransferStat stat = ...' to inside the `if' clause.
	* src/RequestGroup.cc (RequestGroup::reportDownloadFinished)
This commit is contained in:
Tatsuhiro Tsujikawa 2008-09-19 14:15:06 +00:00
parent 67767e2f61
commit f6aaa094a8
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-09-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Moved `TransferStat stat = ...' to inside the `if' clause.
* src/RequestGroup.cc (RequestGroup::reportDownloadFinished)
2008-09-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that a block in a piece is requested when same block is

View File

@ -972,9 +972,9 @@ void RequestGroup::reportDownloadFinished()
_logger->notice(MSG_FILE_DOWNLOAD_COMPLETED,
getFilePath().c_str());
#ifdef ENABLE_BITTORRENT
TransferStat stat = calculateStat();
SharedHandle<BtContext> ctx = dynamic_pointer_cast<BtContext>(_downloadContext);
if(!ctx.isNull()) {
TransferStat stat = calculateStat();
double shareRatio = ((stat.getAllTimeUploadLength()*10)/getCompletedLength())/10.0;
_logger->notice(MSG_SHARE_RATIO_REPORT,
shareRatio,