Ignore:
Timestamp:
Jun 16, 2010, 3:05:23 AM (12 years ago)
Author:
charles
Message:

(libT) #3291 "tr_torrent.infoDictOffset should be lazily evaluated"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r10736 r10774  
    738738static tr_parse_result
    739739torrentParseImpl( const tr_ctor * ctor, tr_info * setmeInfo,
    740                   tr_bool * setmeHasInfo, int * dictOffset, int * dictLength )
     740                  tr_bool * setmeHasInfo, int * dictLength )
    741741{
    742742    int             doFree;
     
    756756
    757757    didParse = tr_metainfoParse( session, metainfo, setmeInfo,
    758                                  &hasInfo, dictOffset, dictLength );
     758                                 &hasInfo, dictLength );
    759759    doFree = didParse && ( setmeInfo == &tmp );
    760760
     
    780780tr_torrentParse( const tr_ctor * ctor, tr_info * setmeInfo )
    781781{
    782     return torrentParseImpl( ctor, setmeInfo, NULL, NULL, NULL );
     782    return torrentParseImpl( ctor, setmeInfo, NULL, NULL );
    783783}
    784784
     
    786786tr_torrentNew( const tr_ctor * ctor, int * setmeError )
    787787{
    788     int off, len;
     788    int len;
    789789    tr_bool hasInfo;
    790790    tr_info tmpInfo;
     
    795795    assert( tr_isSession( tr_ctorGetSession( ctor ) ) );
    796796
    797     r = torrentParseImpl( ctor, &tmpInfo, &hasInfo, &off, &len );
     797    r = torrentParseImpl( ctor, &tmpInfo, &hasInfo, &len );
    798798    if( r == TR_PARSE_OK )
    799799    {
     
    801801        tor->info = tmpInfo;
    802802        if( hasInfo )
    803         {
    804             tor->infoDictOffset = off;
    805803            tor->infoDictLength = len;
    806         }
    807804        torrentInit( tor, ctor );
    808805    }
     
    21962193        memset( &tmpInfo, 0, sizeof( tr_info ) );
    21972194        if( tr_metainfoParse( tor->session, &metainfo, &tmpInfo,
    2198                               &hasInfo, &tor->infoDictOffset, &tor->infoDictLength ) )
     2195                              &hasInfo, &tor->infoDictLength ) )
    21992196        {
    22002197            /* it's good, so keep these new trackers and free the old ones */
Note: See TracChangeset for help on using the changeset viewer.