A tiny Transmission.app hack

(A post every 10 months. I hope that does not annoy you :) It will not take long to read, anyway. )

Transmission is a great BitTorrent client. It is full of features (look at the site!), including bandwidth control, and runs on every platform (Linux and Mac :P).
You can choose global upload and download speeds, or shape single torrents among those you are working with.
At home I have a 10mbit connection to the Internet so I rarely limit the torrents, but most of the time when I do it is to reserve a small quantity of bandwidth for Internet browsing while I wait, or to play online.

Transmission is a bit rigid regarding the possible speeds: the only possible values (for both upload and download) expressed in kilobytes/sec are 5, 10, 20, 30, 40, 50, 75, 100, 150, 200, 250, 500, 750, 1000, 1500, 2000. My home network chokes around 600. I could set for 500k, but where’s the fun?

So:

  • head to https://trac.transmissionbt.com/wiki/Building and read thoroughly [the part specifying that you need to have XCode installed, for example]
  • learn that “Building the project on Mac requires the source to be retrieved from SVN. Pre-packaged source code will not compile.
  • download the SVN code (uhm, yes. I also have pkgsrc installed):
    svn co svn://svn.transmissionbt.com/Transmission/trunk Transmission
    in my case the version number was 2.11 1133-something.
  • run a “dry” compile run — this will guarantee that the code is not broken before you start tinkering with it or that you have some local issue (my first time doing actually something with XCode. Easier than I thought, the source has an XCode project file)
  • find the relevant source files (grep was my friend). In the end I only modified Controller.m and TorrentTableView.m: find the line
    const NSInteger speedLimitActionValue[] = { 5, 10, 20, 30, 40, 50, 75,
    100, 150, 200, 250, 500, 750, 1000, 1500, 2000, -1 };

    and modify it to match the speeds you want to be able to use. You can add or remove values as you like as long as the syntax is right.
  • compile it again and run it. :)

If I were a programmer, I’d have implemented something that would allow the user to choose the speed as he liked — but this fits my needs.

Author: zen

Geek of all trades, having fun with *NIX, the Internet and computer security since 1995.

Leave a Reply

Your email address will not be published. Required fields are marked *