Changeset 12847


Ignore:
Timestamp:
Sep 6, 2011, 4:10:27 PM (10 years ago)
Author:
jordan
Message:

(trunk libt) #4437 'multi file webseeds do not work' -- revert r12740, which was a bad patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/webseed.c

    r12740 r12847  
    4242    long                 response_code;
    4343    int                  torrent_id;
    44     bool                 bad_range;
    4544};
    4645
     
    416415                ++w->retry_tickcount;
    417416
    418             t->bad_range = response_code == 416;
    419 
    420417            tr_list_remove_data( &w->tasks, t );
    421418            evbuffer_free( t->content );
     
    460457
    461458static struct evbuffer *
    462 make_url( struct tr_webseed_task * t, const tr_file * file )
     459make_url( tr_webseed * w, const tr_file * file )
    463460{
    464461    struct evbuffer * buf = evbuffer_new( );
    465     struct tr_webseed * w = t->webseed;
    466462
    467463    evbuffer_add( buf, w->base_url, w->base_url_len );
    468464
    469     if( t->bad_range || ( w->base_url[w->base_url_len - 1] == '/' && file->name ) ) {
    470         if( t->bad_range )
    471             evbuffer_add( buf, "/", 1 );
     465    /* if url ends with a '/', add the torrent name */
     466    if( w->base_url[w->base_url_len - 1] == '/' && file->name )
    472467        tr_http_escape( buf, file->name, strlen(file->name), false );
    473     }
    474468
    475469    return buf;
     
    506500
    507501        if( !urls[file_index] )
    508             urls[file_index] = evbuffer_free_to_str( make_url( t, file ) );
     502            urls[file_index] = evbuffer_free_to_str( make_url( t->webseed, file ) );
    509503
    510504        tr_snprintf( range, sizeof range, "%"PRIu64"-%"PRIu64,
Note: See TracChangeset for help on using the changeset viewer.