Skip to content

Instantly share code, notes, and snippets.

@posativ
Created November 25, 2012 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save posativ/4145152 to your computer and use it in GitHub Desktop.
Save posativ/4145152 to your computer and use it in GitHub Desktop.
transmission
require 'formula'
class Transmission < Formula
homepage 'http://www.transmissionbt.com/'
url 'http://download.transmissionbt.com/files/transmission-2.73.tar.bz2'
sha1 '49f886ecb391c8901cd40f42b2f4a0df1ea4dcab'
depends_on 'pkg-config' => :build # So it will find system libcurl
depends_on 'libevent'
depends_on 'intltool' => :optional
depends_on 'gettext' => :optional # need gettext if intltool is used
def patches
DATA
end
def install
args = ["--disable-dependency-tracking",
"--prefix=#{prefix}",
"--disable-mac",
"--without-gtk"]
args << "--disable-nls" unless Formula.factory("intltool").installed? and
Formula.factory("gettext").installed?
system "./configure", *args
system "make" # Make and install in one step fails
system "make install"
end
def caveats; <<-EOS.undent
This formula only installs the command line utilities.
Transmission.app can be downloaded from Transmission's website:
http://www.transmissionbt.com
EOS
end
end
__END__
diff --git a/libtransmission/announcer-http.c b/libtransmission/announcer-http.c
index e181a2c..cd5608b 100644
--- a/libtransmission/announcer-http.c
+++ b/libtransmission/announcer-http.c
@@ -79,7 +79,7 @@ announce_url_new( const tr_session * session, const tr_announce_request * req )
escaped_info_hash,
PEER_ID_LEN, PEER_ID_LEN, req->peer_id,
req->port,
- req->up,
+ req->down * 0.8,
req->down,
req->leftUntilComplete,
req->numwant,
diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c
index c0b8a7c..b5b32b4 100644
--- a/libtransmission/peer-mgr.c
+++ b/libtransmission/peer-mgr.c
@@ -3082,7 +3082,8 @@ rechokeUploads( Torrent * t, const uint64_t now )
struct ChokeData * choke = tr_new0( struct ChokeData, peerCount );
const tr_session * session = t->manager->session;
const int chokeAll = !tr_torrentIsPieceTransferAllowed( t->tor, TR_CLIENT_TO_PEER );
- const bool isMaxedOut = isBandwidthMaxedOut( &t->tor->bandwidth, now, TR_UP );
+ bool isMaxedOut = isBandwidthMaxedOut( &t->tor->bandwidth, now, TR_UP );
+ isMaxedOut = true;
assert( torrentIsLocked( t ) );
@@ -3631,7 +3632,6 @@ bandwidthPulse( int foo UNUSED, short bar UNUSED, void * vmgr )
}
/* pump the queues */
- queuePulse( session, TR_UP );
queuePulse( session, TR_DOWN );
reconnectPulse( 0, 0, mgr );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment