2007-11-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Return false if RequestGroup::isPreLocalFileCheckEnabled() == 
true
	* src/RequestGroupMan.cc (isSameFileBeingDownloaded)

	Return false if RequestGroup::isPreLocalFileCheckEnabled() == 
true
	* src/RequestGroup.cc (downloadFinishedByFileLength)
pull/1/head
Tatsuhiro Tsujikawa 2007-11-25 11:48:44 +00:00
parent cf59b13193
commit 1dc88d47ab
3 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2007-11-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Return false if RequestGroup::isPreLocalFileCheckEnabled() == true
* src/RequestGroupMan.cc (isSameFileBeingDownloaded)
Return false if RequestGroup::isPreLocalFileCheckEnabled() == true
* src/RequestGroup.cc (downloadFinishedByFileLength)
2007-11-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> 2007-11-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the check to see whether ares_host_callback accepts timeouts Added the check to see whether ares_host_callback accepts timeouts

View File

@ -271,7 +271,8 @@ void RequestGroup::initPieceStorage()
bool RequestGroup::downloadFinishedByFileLength() bool RequestGroup::downloadFinishedByFileLength()
{ {
// assuming that a control file doesn't exist. // assuming that a control file doesn't exist.
if(_option->get(PREF_ALLOW_OVERWRITE) == V_TRUE || if(!isPreLocalFileCheckEnabled() ||
_option->get(PREF_ALLOW_OVERWRITE) == V_TRUE ||
_option->get(PREF_CHECK_INTEGRITY) == V_TRUE && _option->get(PREF_CHECK_INTEGRITY) == V_TRUE &&
!_downloadContext->getPieceHashes().empty()) { !_downloadContext->getPieceHashes().empty()) {
return false; return false;

View File

@ -260,6 +260,10 @@ string RequestGroupMan::formatDownloadResult(const string& status, const Request
bool RequestGroupMan::isSameFileBeingDownloaded(RequestGroup* requestGroup) const bool RequestGroupMan::isSameFileBeingDownloaded(RequestGroup* requestGroup) const
{ {
// TODO it may be good to use dedicated method rather than use isPreLocalFileCheckEnabled
if(!requestGroup->isPreLocalFileCheckEnabled()) {
return false;
}
for(RequestGroups::const_iterator itr = _requestGroups.begin(); for(RequestGroups::const_iterator itr = _requestGroups.begin();
itr != _requestGroups.end(); ++itr) { itr != _requestGroups.end(); ++itr) {
if((*itr).get() != requestGroup && if((*itr).get() != requestGroup &&