Changeset 9866


Ignore:
Timestamp:
Jan 4, 2010, 8:28:54 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #2711 "no metadata exchange when using magnet links and trackerless torrents" -- fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r9863 r9866  
    691691}
    692692
    693 tr_parse_result
    694 tr_torrentParse( const tr_ctor * ctor, tr_info * setmeInfo )
     693static tr_parse_result
     694torrentParseImpl( const tr_ctor * ctor, tr_info * setmeInfo,
     695                  int * dictOffset, int * dictLength )
    695696{
    696697    int             doFree;
     
    708709        return TR_PARSE_ERR;
    709710
    710     didParse = tr_metainfoParse( session, setmeInfo, NULL, NULL, metainfo );
     711    didParse = tr_metainfoParse( session, setmeInfo, dictOffset, dictLength, metainfo );
    711712    doFree = didParse && ( setmeInfo == &tmp );
    712713
     
    726727}
    727728
     729tr_parse_result
     730tr_torrentParse( const tr_ctor * ctor, tr_info * setmeInfo )
     731{
     732    return torrentParseImpl( ctor, setmeInfo, NULL, NULL );
     733}
     734
    728735tr_torrent *
    729 tr_torrentNew( const tr_ctor  * ctor,
    730                int            * setmeError )
     736tr_torrentNew( const tr_ctor * ctor, int * setmeError )
    731737{
    732738    tr_info tmpInfo;
     
    754760    else
    755761    {
    756         const int err = tr_torrentParse( ctor, &tmpInfo );
    757         if( !err )
     762        int off, len;
     763        tr_parse_result r = torrentParseImpl( ctor, &tmpInfo, &off, &len );
     764        if( r == TR_PARSE_OK )
    758765        {
    759766            tor = tr_new0( tr_torrent, 1 );
    760767            tor->info = tmpInfo;
     768            tor->infoDictOffset = off;
     769            tor->infoDictLength = len;
    761770            torrentInit( tor, ctor );
    762771        }
    763772        else if( setmeError )
    764773        {
    765             *setmeError = err;
     774            *setmeError = r;
    766775        }
    767776    }
Note: See TracChangeset for help on using the changeset viewer.