Changeset 3572 for trunk/libtransmission/fastresume.c
- Timestamp:
- Oct 26, 2007, 3:02:23 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/fastresume.c
r3568 r3572 331 331 332 332 static int 333 load FallbackDestination( tr_torrent * tor, FILE * fp)333 loadDestination( tr_torrent * tor, FILE * fp, const char * destination, int argIsFallback ) 334 334 { 335 335 int pathlen = 0; 336 336 char path[MAX_PATH_LENGTH]; 337 const int haveDestination = tor->destination && *tor->destination;338 337 339 338 for( ;; ) { … … 348 347 path[pathlen] = '\0'; 349 348 350 if( pathlen && !haveDestination ) {351 t r_free( tor->destination );352 tor->destination = tr_strdup( path );353 }349 if( argIsFallback ) 350 tor->destination = tr_strdup( pathlen ? path : destination ); 351 else 352 tor->destination = tr_strdup( destination && *destination ? destination : path ); 354 353 355 354 return TR_OK; … … 526 525 static uint64_t 527 526 fastResumeLoadImpl ( tr_torrent * tor, 528 tr_bitfield * uncheckedPieces ) 527 tr_bitfield * uncheckedPieces, 528 const char * destination, 529 int argIsFallback ) 529 530 { 530 531 char path[MAX_PATH_LENGTH]; … … 630 631 case FR_ID_DESTINATION: 631 632 { 632 const int rret = load FallbackDestination( tor, file);633 const int rret = loadDestination( tor, file, destination, argIsFallback ); 633 634 634 635 if( rret && ( feof(file) || ferror(file) ) ) … … 773 774 uint64_t 774 775 tr_fastResumeLoad( tr_torrent * tor, 775 tr_bitfield * uncheckedPieces ) 776 { 777 const uint64_t ret = fastResumeLoadImpl( tor, uncheckedPieces ); 776 tr_bitfield * uncheckedPieces, 777 const char * destination, 778 int argIsFallback ) 779 { 780 const uint64_t ret = fastResumeLoadImpl( tor, uncheckedPieces, destination, argIsFallback ); 778 781 779 782 if( ! ( ret & TR_FR_PROGRESS ) ) 780 783 tr_bitfieldAddRange( uncheckedPieces, 0, tor->info.pieceCount ); 781 784 785 if( !tor->destination ) 786 tor->destination = tr_strdup( destination ); 787 782 788 return ret; 783 789 }
Note: See TracChangeset
for help on using the changeset viewer.