support in libT for individual torrent speed caps
This commit is contained in:
parent
cedcbf701e
commit
ca2c729abd
|
@ -266,7 +266,8 @@ int tr_peerRead( tr_torrent_t * tor, tr_peer_t * peer )
|
|||
/* Try to read */
|
||||
for( ;; )
|
||||
{
|
||||
if( tor && !tr_rcCanTransfer( tor->globalDownload ) )
|
||||
if( tor && (!tr_rcCanTransfer( tor->globalDownload )
|
||||
|| !tr_rcCanTransfer( tor->download ) ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -436,7 +437,8 @@ writeBegin:
|
|||
/* Send pieces if we can */
|
||||
while( ( p = blockPending( tor, peer, &size ) ) )
|
||||
{
|
||||
if( !tr_rcCanTransfer( tor->globalUpload ) )
|
||||
if( !tr_rcCanTransfer( tor->globalUpload )
|
||||
|| !tr_rcCanTransfer( tor->upload ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -201,6 +201,16 @@ void tr_setGlobalDownloadLimit( tr_handle_t * h, int limit )
|
|||
tr_rcSetLimit( h->download, limit );
|
||||
}
|
||||
|
||||
void tr_setUploadLimit( tr_torrent_t * tor, int limit )
|
||||
{
|
||||
tr_rcSetLimit( tor->upload, limit );
|
||||
}
|
||||
|
||||
void tr_setDownloadLimit( tr_torrent_t * tor, int limit )
|
||||
{
|
||||
tr_rcSetLimit( tor->download, limit );
|
||||
}
|
||||
|
||||
void tr_torrentRates( tr_handle_t * h, float * dl, float * ul )
|
||||
{
|
||||
tr_torrent_t * tor;
|
||||
|
|
Loading…
Reference in New Issue