Changeset 12855


Ignore:
Timestamp:
Sep 12, 2011, 5:39:27 AM (7 years ago)
Author:
jordan
Message:

(trunk libT) #4445 "transmission only downloads partially from webseeds with redirections" -- fixed with patch from alexat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/webseed.c

    r12847 r12855  
    254254    }
    255255
     256    len = evbuffer_get_length( buf );
     257
    256258    if( !task->response_code ) {
    257259        tr_webGetTaskInfo( task->web_task, TR_WEB_GET_CODE, &task->response_code );
     
    263265            inf->webseed = w;
    264266            inf->piece_index = task->piece_index;
    265             inf->piece_offset = task->piece_offset;
     267            inf->piece_offset = task->piece_offset
     268                              + (task->blocks_done * task->block_size)
     269                              + (len - 1);
    266270            tr_webGetTaskInfo( task->web_task, TR_WEB_GET_REDIRECTS, &redirects );
    267271            if( redirects ) {
     
    273277                inf->redirect_url = NULL;
    274278            /* run this in the webseed thread to avoid tampering with mutexes and to
    275             not cost the web thrad too much time */
     279            not cost the web thread too much time */
    276280            tr_runInEventThread( task->session, connection_succeeded, inf );
    277281        }
    278282    }
    279 
    280     len = evbuffer_get_length( buf );
    281283
    282284    if( task->response_code == 206 && len >= task->block_size )
Note: See TracChangeset for help on using the changeset viewer.