fix bug where when a file location was changed the valid download amount would double
This commit is contained in:
parent
64b5583a10
commit
13ab13d0d0
|
@ -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 );
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue