diff --git a/NEWS b/NEWS index cc3b711f2..7839d06bc 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ NEWS file for Transmission - libtransmission (all platforms): + Fix 0.90 socket connection leak + Fix 0.90 OpenBSD build error + + Fix 0.90 cache bug that could cause "verify local files" to fail. + Ensure only a single "?" is used for appending arguments to the announce and scrape URL - OS X: + Fix a crash caused by custom sound files diff --git a/libtransmission/fastresume.c b/libtransmission/fastresume.c index f4a351ee7..74b66e164 100644 --- a/libtransmission/fastresume.c +++ b/libtransmission/fastresume.c @@ -439,24 +439,28 @@ fastResumeLoadProgress( const tr_torrent * tor, tr_bitfield * uncheckedPieces, FILE * file ) { - int i; const size_t len = FR_PROGRESS_LEN( tor ); uint8_t * buf = calloc( len, 1 ); - uint8_t * walk = buf; + int ret = 0; + int i; - if( len != fread( buf, 1, len, file ) ) { + if( len != fread( buf, 1, len, file ) ) + { tr_inf( "Couldn't read from resume file" ); - free( buf ); - return TR_ERROR_IO_OTHER; + tr_bitfieldAddRange( uncheckedPieces, 0, tor->info.pieceCount ); + ret = TR_ERROR_IO_OTHER; } - - /* compare file mtimes */ - if (1) { + else + { int n; + tr_bitfield bitfield; + + /* compare file mtimes */ tr_time_t * curMTimes = getMTimes( tor, &n ); + uint8_t * walk = buf; const tr_time_t * oldMTimes = (const tr_time_t *) walk; for( i=0; iinfo.files[i]; tr_dbg( "File '%s' mtimes differ-- flagging pieces [%d..%d] for recheck", file->name, file->firstPiece, file->lastPiece); @@ -466,11 +470,8 @@ fastResumeLoadProgress( const tr_torrent * tor, } free( curMTimes ); walk += n * sizeof(tr_time_t); - } - /* get the completion bitfield */ - if (1) { - tr_bitfield bitfield; + /* get the completion bitfield */ memset( &bitfield, 0, sizeof bitfield ); bitfield.len = FR_BLOCK_BITFIELD_LEN( tor ); bitfield.bits = walk; @@ -485,7 +486,7 @@ fastResumeLoadProgress( const tr_torrent * tor, free( buf ); - return TR_OK; + return ret; } static uint64_t