Changeset 250


Ignore:
Timestamp:
May 3, 2006, 5:41:51 PM (15 years ago)
Author:
titer
Message:

Be more flexible in case the dictionary isn't at the beginning of the
body (refs http://transmission.m0k.org/forum/viewtopic.php?t=298)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tracker.c

    r245 r250  
    441441    bodylen = tc->pos - (body - tc->buf);
    442442
    443     /* Find the beginning of the dictionary */
     443    /* Find and load the dictionary */
    444444    for( i = 0; i < bodylen; i++ )
    445445    {
    446         if( body[i] == 'd' )
    447         {
    448             /* This must be it */
     446        if( !tr_bencLoad( &body[i], bodylen - i, &beAll, NULL ) )
     447        {
    449448            break;
    450449        }
     
    458457            goto nodict;
    459458        }
    460         tr_err( "Tracker: no dictionary in answer" );
    461         tc->lastAttempt = TC_ATTEMPT_ERROR;
    462         return;
    463     }
    464 
    465     if( tr_bencLoad( &body[i], bodylen - i, &beAll, NULL ) )
    466     {
    467         tr_err( "Tracker: error parsing bencoded data" );
     459        tr_err( "Tracker: no valid dictionary found in answer" );
    468460        tc->lastAttempt = TC_ATTEMPT_ERROR;
    469461        return;
Note: See TracChangeset for help on using the changeset viewer.