if a transfer is checking decrease the queue count for both queues but don't start the transfer

This commit is contained in:
Mitchell Livingston 2007-06-30 16:13:10 +00:00
parent b6819d6a12
commit 19c7d8367a
3 changed files with 13 additions and 10 deletions

View File

@ -1410,7 +1410,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
NSEnumerator * enumerator = [sortedTorrents objectEnumerator];
while ((torrent = [enumerator nextObject]))
{
if (![torrent isActive] && [torrent waitingToStart])
if (![torrent isActive] && ![torrent isChecking] && [torrent waitingToStart])
{
if (![torrent allDownloaded])
{
@ -1450,7 +1450,14 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
Torrent * torrent;
NSEnumerator * enumerator = [fTorrents objectEnumerator];
while ((torrent = [enumerator nextObject]))
if ([torrent isActive] && ![torrent isStalled] && ![torrent isError])
{
if ([torrent isChecking])
{
desired--;
if (desired <= 0)
return 0;
}
else if ([torrent isActive] && ![torrent isStalled] && ![torrent isError])
{
if ([torrent allDownloaded] != downloadQueue)
{
@ -1459,6 +1466,8 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
return 0;
}
}
else;
}
return desired;
}

View File

@ -163,7 +163,6 @@
- (BOOL) isActive;
- (BOOL) isSeeding;
- (BOOL) isPaused;
- (BOOL) isWaitingToChecking;
- (BOOL) isChecking;
- (BOOL) allDownloaded;
- (BOOL) isError;

View File

@ -486,7 +486,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
if ((wasChecking && !fChecking) || (!wasStalled && fStalled) || (!wasError && fError && [self isActive]))
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateQueue" object: self];
if ([self isActive] && ![self isChecking] && ![self isWaitingToChecking] )
if ([self isActive] && ![self isChecking])
{
NSString * stringToAppend = @"";
if (![self allDownloaded])
@ -1079,14 +1079,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
return fStat->status == TR_STATUS_STOPPED;
}
- (BOOL) isWaitingToChecking
{
return fStat->status == TR_STATUS_CHECK_WAIT;
}
- (BOOL) isChecking
{
return fStat->status == TR_STATUS_CHECK;
return fStat->status == TR_STATUS_CHECK || fStat->status == TR_STATUS_CHECK_WAIT;
}
- (BOOL) allDownloaded