1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

delete the old resume file after migrating to the new format

This commit is contained in:
Charles Kerr 2008-04-14 03:12:24 +00:00
parent 612e7221a9
commit a08ef82039

View file

@ -341,10 +341,20 @@ tr_torrentLoadResume( tr_torrent * tor,
content = tr_loadFile( filename, &contentLen );
benc_loaded = content && !tr_bencLoad( content, contentLen, &top, NULL );
if( !benc_loaded ) {
if( !benc_loaded )
{
tr_free( content );
tr_tordbg( tor, "Couldn't read \"%s\"; trying old resume file format.", filename );
return tr_fastResumeLoad( tor, fieldsToLoad, ctor );
fieldsLoaded = tr_fastResumeLoad( tor, fieldsToLoad, ctor );
if( ( fieldsLoaded != 0 ) && ( fieldsToLoad == ~(uint64_t)0 ) )
{
tr_torrentSaveResume( tor );
tr_fastResumeRemove( tor );
tr_tordbg( tor, "Migrated resume file to \"%s\"", filename );
}
return fieldsLoaded;
}
tr_tordbg( tor, "Read resume file \"%s\"", filename );