fix bug where when a file location was changed the valid download amount would double

This commit is contained in:
Mitchell Livingston 2007-05-24 15:57:04 +00:00
parent 64b5583a10
commit 13ab13d0d0
3 changed files with 11 additions and 1 deletions

View File

@ -76,6 +76,7 @@ void tr_ioLoadResume( tr_torrent_t * tor )
io->slotPiece = malloc( inf->pieceCount * sizeof( int ) );
fastResumeLoad( io );
tor->ioLoaded = 1;
free( io->pieceSlot );
free( io->slotPiece );

View File

@ -195,6 +195,7 @@ struct tr_torrent_s
tr_tracker_t * tracker;
tr_io_t * io;
uint64_t stopDate;
int ioLoaded;
int peerCount;
tr_peer_t * peers[TR_MAX_PEER_COUNT];

View File

@ -230,7 +230,15 @@ int tr_torrentScrape( tr_torrent_t * tor, int * s, int * l, int * d )
void tr_torrentSetFolder( tr_torrent_t * tor, const char * path )
{
tor->destination = strdup( path );
tr_ioLoadResume( tor );
if ( !tor->ioLoaded )
{
tr_ioLoadResume( tor );
}
}
void tr_torrentChangeFolder( tr_torrent_t * tor, const char * path )
{
tor->destination = strdup( path );
}
char * tr_torrentGetFolder( tr_torrent_t * tor )