anchor.diff:  -define(SERVER, ?MODULE).
   -define(RANDOM_MAX_SIZE, 1000000000).
   
  --record(state, { tracking_map,
  -		 local_peer_id }).
  +-record(state, {local_peer_id}).
   
   %% API
   
  
positive.code: 
  %% Callbacks
  init(_Args) ->
      {ok, #state { tracking_map = ets:new(torrent_tracking_table,
  					 [named_table]),
  		  local_peer_id = generate_peer_id()}}.
  
  handle_cast({start_torrent, F}, S) ->
      spawn_new_torrent(F, S),
      {noreply, S};
  handle_cast({stop_torrent, F}, S) ->
      error_logger:info_msg("Stopping ~p~n", [F]),
      case ets:lookup(S#state.tracking_map, F) of
  	[{F, _TorrentSup}] ->
  	    etorrent_t_pool_sup:stop_torrent(F),
  	    {noreply, S};
  	[] -> % Torrent already got the 'DOWN' message and was removed
  	    {noreply, S}
  	end.
  
  handle_call(_A, _B, S) ->
      {noreply, S}.
  
  handle_info({'DOWN', _R, process, Pid, _Reason}, S) ->
      error_logger:info_msg("Got Down Msg ~p~n", [Pid]),
      [[F]] = ets:match(S#state.tracking_map, {'$1', Pid}),
      ets:delete(S#state.tracking_map, F),
      {noreply, S};
  handle_info(Info, State) ->
      error_logger:info_msg("Unknown message: ~p~n", [Info]),
  
negative.code: -module(etorrent_t_manager).
  -behaviour(gen_server).
  
  -include_lib("stdlib/include/qlc.hrl").
  
  -include("etorrent_version.hrl").
  -include("etorrent_mnesia_table.hrl").
  
  -export([start_link/0, start_torrent/1, stop_torrent/1]).
  -export([handle_cast/2, handle_call/3, init/1, terminate/2]).
  