Changeset 13310


Ignore:
Timestamp:
May 20, 2012, 2:14:59 PM (9 years ago)
Author:
jordan
Message:

(trunk libT) #4888: when scraping magnet links, don't send a left=0 argument to the tracker.

Location:
trunk/libtransmission
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer-common.h

    r12238 r13310  
    149149
    150150    /* the total size of the torrent minus the number of bytes completed */
    151     uint64_t left;
     151    uint64_t leftUntilComplete;
    152152
    153153    /* the tracker's announce URL */
  • trunk/libtransmission/announcer-http.c

    r13300 r13310  
    8282                              req->up,
    8383                              req->down,
    84                               req->left,
     84                              req->leftUntilComplete,
    8585                              req->numwant,
    8686                              req->key );
  • trunk/libtransmission/announcer-udp.c

    r12982 r13310  
    324324    evbuffer_add        ( buf, in->peer_id, PEER_ID_LEN );
    325325    evbuffer_add_hton_64( buf, in->down );
    326     evbuffer_add_hton_64( buf, in->left );
     326    evbuffer_add_hton_64( buf, in->leftUntilComplete );
    327327    evbuffer_add_hton_64( buf, in->up );
    328328    evbuffer_add_hton_32( buf, get_tau_announce_event( in->event ) );
  • trunk/libtransmission/announcer.c

    r13300 r13310  
    913913    req->down = tier->byteCounts[TR_ANN_DOWN];
    914914    req->corrupt = tier->byteCounts[TR_ANN_CORRUPT];
    915     req->left = tr_cpLeftUntilComplete( &tor->completion );
     915    req->leftUntilComplete = tr_torrentHasMetadata( tor )
     916            ? tor->info.totalSize - tr_cpHaveTotal( &tor->completion )
     917            : ~(uint64_t)0;
    916918    req->event = event;
    917919    req->numwant = event == TR_ANNOUNCE_EVENT_STOPPED ? 0 : NUMWANT;
  • trunk/libtransmission/completion.h

    r12918 r13310  
    9090}
    9191
    92 static inline uint64_t
    93 tr_cpLeftUntilComplete( const tr_completion * cp )
    94 {
    95     return tr_torrentInfo(cp->tor)->totalSize - cp->sizeNow;
    96 }
    97 
    9892static inline bool tr_cpHasAll( const tr_completion * cp )
    9993{
Note: See TracChangeset for help on using the changeset viewer.