anchor.diff:  	    gen_server:cast(Master, {tracker_report, TrackerId, Complete, Incomplete}),
   	    gen_server:cast(Master, {new_ips, NewIPs})
       end,
  -    tick_after(RequestTime).
  -
  -tracker_request({Master, StatePid, Url, InfoHash, PeerId}, Event) ->
  -    RequestToSend = build_request_to_send(StatePid),
  -    case perform_get_request(Url, InfoHash, PeerId, RequestToSend, Event) of
  -	{ok, ResponseBody} ->
  -	    case bcoding:decode(ResponseBody) of
  -		{ok, BC} ->
  -		    handle_tracker_response(BC, Master),
  -		    {noreply, {Master, StatePid, Url, InfoHash, PeerId}};
  -		{error, Err} ->
  -		    gen_server:cast(Master, {tracker_responded_not_bcode, Err}),
  -		    tick_after(180),
  -		    {noreply, {Master, StatePid, Url, InfoHash, PeerId}}
  -	    end;
  -	{error, Err} ->
  -	    gen_server:cast(Master, {tracker_request_failed, Err}),
  -	    tick_after(180),
  -	    {noreply, {Master, StatePid, Url, InfoHash, PeerId}}
  -    end.
  +    {ok, RequestTime}.
   
   perform_get_request(Url, InfoHash, PeerId, Status, Event) ->
       NewUrl = build_tracker_url(Url, Status, InfoHash, PeerId, Event),
       case http:request(NewUrl) of
   	{ok, {{_, 200, _}, _, Body}} ->
  -	    {ok, Body};
  -	_ ->
  -	    %% TODO: We need to fix this. If we can't find anything, this is
  -	    %% triggered. So we must handle it. Oh, we must fix this.
  -	    %% We can take a look on some of the errors and report them back gracefully since it is much easier
  -	    %% to read and understand then.
  -	    {error, "Some error happened in the request get"}
  +	    {ok, Body}
       end.
   
   build_tracker_url(BaseUrl, TrackerRequest, IHash, PrId, Evt) ->
  +    %% TODO: Use io_lib:format for this!
       InfoHash = lists:concat(["info_hash=", IHash]),
       PeerId   = lists:concat(["peer_id=", PrId]),
       %% Ignore port for now
  
positive.code: -define(SERVER, ?MODULE).
  -define(DEFAULT_REQUEST_TIMEOUT, 180).
  
  %% API
  start_link({Master, StatePid, Url, InfoHash, PeerId}) ->
      gen_server:start_link({local, ?SERVER}, ?MODULE, [{Master, StatePid, Url, InfoHash, PeerId}], []).
  
  request_tracker_immediately(Pid) ->
      gen_server:cast(Pid, tracker_request_now).
  
  %% Callbacks
  init({Master, StatePid, Url, InfoHash, PeerId}) ->
      {ok, {Master, StatePid, Url, InfoHash, PeerId}}.
  
  code_change(_OldVsn, State, _Extra) ->
      {ok, State}.
  
  handle_info(_Foo, State) ->
      {noreply, State}.
  
  terminate(shutdown, _State) ->
      ok.
  
  handle_call(_Call, _Who, S) ->
      {noreply, S}.
  
  
  handle_cast(tracker_request_now, State) ->
      tracker_request(State, none);
  handle_cast(start, State) ->
      tracker_request(State, "started");
  handle_cast(stop, State) ->
      tracker_request(State, "stopped").
  
  %% Internal stuff
  tick_after(Secs) ->
      timer:apply_after(Secs * 1000, self(),
  		      fun () -> request_tracker_immediately(self()) end, []).
  
  build_request_to_send(StatePid) ->
      {data_transfer_amounts, Uploaded, Downloaded, Left} =
  
negative.code: %%%-------------------------------------------------------------------
  %%% File    : tracker_delegate.erl
  %%% Author  : Jesper Louis Andersen <jlouis@succubus.local.domain>
  %%% Description : Controls the communication with a tracker.
  %%%
  %%% Created : 12 Jul 2007 by Jesper Louis Andersen <jlouis@succubus.local.domain>
  %%%-------------------------------------------------------------------
  -module(tracker_delegate).
  
  -behaviour(gen_fsm).
  
  %% API
  -export([start_link/5, contact_tracker_now/1]).
  
  %% gen_fsm callbacks
  -export([init/1, ready_to_contact/2, waiting_to_contact/2, state_name/3, handle_event/3,
  	 handle_sync_event/4, handle_info/3, terminate/3, code_change/4]).
  
  -record(state, {should_contact_tracker = false,
  	        state_pid = none,
  	        url = none,
  	        infohash = none,
  	        peer_id = none,
  	        master_pid = none}).
  
  -record(tracker_request,{port = none,
  			 uploaded = 0,
  