Ticket #4888: magnet-left-until-complete.patch
File magnet-left-until-complete.patch, 2.8 KB (added by jordan, 10 years ago) |
---|
-
libtransmission/completion.h
89 89 return cp->sizeNow; 90 90 } 91 91 92 static inline uint64_t93 tr_cpLeftUntilComplete( const tr_completion * cp )94 {95 return tr_torrentInfo(cp->tor)->totalSize - cp->sizeNow;96 }97 98 92 static inline bool tr_cpHasAll( const tr_completion * cp ) 99 93 { 100 94 return tr_bitfieldHasAll( &cp->blockBitfield ); -
libtransmission/announcer.c
912 912 req->up = tier->byteCounts[TR_ANN_UP]; 913 913 req->down = tier->byteCounts[TR_ANN_DOWN]; 914 914 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; 916 918 req->event = event; 917 919 req->numwant = event == TR_ANNOUNCE_EVENT_STOPPED ? 0 : NUMWANT; 918 920 req->key = announcer->key; -
libtransmission/announcer-udp.c
323 323 evbuffer_add ( buf, in->info_hash, SHA_DIGEST_LENGTH ); 324 324 evbuffer_add ( buf, in->peer_id, PEER_ID_LEN ); 325 325 evbuffer_add_hton_64( buf, in->down ); 326 evbuffer_add_hton_64( buf, in->left );326 evbuffer_add_hton_64( buf, in->leftUntilComplete ); 327 327 evbuffer_add_hton_64( buf, in->up ); 328 328 evbuffer_add_hton_32( buf, get_tau_announce_event( in->event ) ); 329 329 evbuffer_add_hton_32( buf, 0 ); -
libtransmission/announcer-common.h
148 148 uint64_t corrupt; 149 149 150 150 /* the total size of the torrent minus the number of bytes completed */ 151 uint64_t left ;151 uint64_t leftUntilComplete; 152 152 153 153 /* the tracker's announce URL */ 154 154 char * url; -
libtransmission/announcer-http.c
81 81 req->port, 82 82 req->up, 83 83 req->down, 84 req->left ,84 req->leftUntilComplete, 85 85 req->numwant, 86 86 req->key ); 87 87