Changeset 9860


Ignore:
Timestamp:
Jan 4, 2010, 9:11:27 AM (12 years ago)
Author:
charles
Message:

(trunk libT) #2722 "crash when removing/modifying trackers" -- fixed

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer.c

    r9756 r9860  
    16981698{
    16991699    tr_announcer * announcer = vannouncer;
     1700    tr_sessionLock( announcer->session );
    17001701
    17011702    /* maybe send out some "stopped" messages for closed torrents */
     
    17071708    /* set up the next timer */
    17081709    tr_timerAdd( announcer->upkeepTimer, UPKEEP_INTERVAL_SECS, 0 );
     1710
     1711    tr_sessionUnlock( announcer->session );
    17091712}
    17101713
  • trunk/libtransmission/torrent.c

    r9859 r9860  
    20902090    int i;
    20912091    tr_benc metainfo;
     2092    tr_bool ok = TRUE;
     2093    tr_torrentLock( tor );
    20922094
    20932095    assert( tr_isTorrent( tor ) );
    20942096
    20952097    /* look for bad URLs */
    2096     for( i=0; i<trackerCount; ++i )
     2098    for( i=0; ok && i<trackerCount; ++i )
    20972099        if( !tr_httpIsValidURL( trackers[i].announce ) )
    2098             return TR_ANNOUNCE_LIST_HAS_BAD;
     2100            ok = FALSE;
    20992101
    21002102    /* save to the .torrent file */
    2101     if( !tr_bencLoadFile( &metainfo, TR_FMT_BENC, tor->info.torrent ) )
     2103    if( ok && !tr_bencLoadFile( &metainfo, TR_FMT_BENC, tor->info.torrent ) )
    21022104    {
    21032105        tr_info   tmpInfo;
     
    21562158    }
    21572159
    2158     return TR_ANNOUNCE_LIST_OK;
     2160    tr_torrentUnlock( tor );
     2161    return ok ? TR_ANNOUNCE_LIST_OK : TR_ANNOUNCE_LIST_HAS_BAD;
    21592162}
    21602163
Note: See TracChangeset for help on using the changeset viewer.