Changeset 5610


Ignore:
Timestamp:
Apr 14, 2008, 3:12:24 AM (14 years ago)
Author:
charles
Message:

delete the old resume file after migrating to the new format

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/resume.c

    r5608 r5610  
    342342    content = tr_loadFile( filename, &contentLen );
    343343    benc_loaded = content && !tr_bencLoad( content, contentLen, &top, NULL );
    344     if( !benc_loaded ) {
     344    if( !benc_loaded )
     345    {
    345346        tr_free( content );
    346347        tr_tordbg( tor, "Couldn't read \"%s\"; trying old resume file format.", filename );
    347         return tr_fastResumeLoad( tor, fieldsToLoad, ctor );
     348        fieldsLoaded = tr_fastResumeLoad( tor, fieldsToLoad, ctor );
     349
     350        if( ( fieldsLoaded != 0 ) && ( fieldsToLoad == ~(uint64_t)0 ) )
     351        {
     352            tr_torrentSaveResume( tor );
     353            tr_fastResumeRemove( tor );
     354            tr_tordbg( tor, "Migrated resume file to \"%s\"", filename );
     355        }
     356
     357        return fieldsLoaded;
    348358    }
    349359
Note: See TracChangeset for help on using the changeset viewer.