mirror of
https://github.com/transmission/transmission
synced 2025-02-22 14:10:34 +00:00
(trunk libT) #4888: when scraping magnet links, don't send a left=0 argument to the tracker.
This commit is contained in:
parent
9756b5dcf1
commit
e9e76fa970
5 changed files with 6 additions and 10 deletions
|
@ -148,7 +148,7 @@ typedef struct
|
|||
uint64_t corrupt;
|
||||
|
||||
/* the total size of the torrent minus the number of bytes completed */
|
||||
uint64_t left;
|
||||
uint64_t leftUntilComplete;
|
||||
|
||||
/* the tracker's announce URL */
|
||||
char * url;
|
||||
|
|
|
@ -81,7 +81,7 @@ announce_url_new( const tr_session * session, const tr_announce_request * req )
|
|||
req->port,
|
||||
req->up,
|
||||
req->down,
|
||||
req->left,
|
||||
req->leftUntilComplete,
|
||||
req->numwant,
|
||||
req->key );
|
||||
|
||||
|
|
|
@ -323,7 +323,7 @@ tau_announce_request_new( const tr_announce_request * in,
|
|||
evbuffer_add ( buf, in->info_hash, SHA_DIGEST_LENGTH );
|
||||
evbuffer_add ( buf, in->peer_id, PEER_ID_LEN );
|
||||
evbuffer_add_hton_64( buf, in->down );
|
||||
evbuffer_add_hton_64( buf, in->left );
|
||||
evbuffer_add_hton_64( buf, in->leftUntilComplete );
|
||||
evbuffer_add_hton_64( buf, in->up );
|
||||
evbuffer_add_hton_32( buf, get_tau_announce_event( in->event ) );
|
||||
evbuffer_add_hton_32( buf, 0 );
|
||||
|
|
|
@ -912,7 +912,9 @@ announce_request_new( const tr_announcer * announcer,
|
|||
req->up = tier->byteCounts[TR_ANN_UP];
|
||||
req->down = tier->byteCounts[TR_ANN_DOWN];
|
||||
req->corrupt = tier->byteCounts[TR_ANN_CORRUPT];
|
||||
req->left = tr_cpLeftUntilComplete( &tor->completion );
|
||||
req->leftUntilComplete = tr_torrentHasMetadata( tor )
|
||||
? tor->info.totalSize - tr_cpHaveTotal( &tor->completion )
|
||||
: ~(uint64_t)0;
|
||||
req->event = event;
|
||||
req->numwant = event == TR_ANNOUNCE_EVENT_STOPPED ? 0 : NUMWANT;
|
||||
req->key = announcer->key;
|
||||
|
|
|
@ -89,12 +89,6 @@ tr_cpHaveTotal( const tr_completion * cp )
|
|||
return cp->sizeNow;
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
tr_cpLeftUntilComplete( const tr_completion * cp )
|
||||
{
|
||||
return tr_torrentInfo(cp->tor)->totalSize - cp->sizeNow;
|
||||
}
|
||||
|
||||
static inline bool tr_cpHasAll( const tr_completion * cp )
|
||||
{
|
||||
return tr_bitfieldHasAll( &cp->blockBitfield );
|
||||
|
|
Loading…
Reference in a new issue