anchor.diff:  %% gen_server callbacks
   %%====================================================================
   init([Socket, FilesystemPid, TorrentId, FastExtension, Parent]) ->
  +    %% Trap exits so we can cancel timers gracefully should we die
       process_flag(trap_exit, true),
       {ok, TRef} = timer:send_interval(?DEFAULT_KEEP_ALIVE_INTERVAL, self(), tick),
       {ok, Tref2} = timer:send_interval(?RATE_UPDATE, self(), rate_update),
  
positive.code:             torrent_id = TorrentId,
              fast_extension = FastExtension,
              file_system_pid = FilesystemPid},
       0}.
  
  %%--------------------------------------------------------------------
  %% Function: %% handle_call(Request, From, State) -> {reply, Reply, State} |
  %%                                      {reply, Reply, State, Timeout} |
  %%                                      {noreply, State} |
  %%                                      {noreply, State, Timeout} |
  %%                                      {stop, Reason, Reply, State} |
  %%                                      {stop, Reason, State}
  %% Description: Handling call messages
  %%--------------------------------------------------------------------
  handle_call(_Request, _From, State) ->
      Reply = ok,
      {reply, Reply, State}.
  
  %%--------------------------------------------------------------------
  %% Func: code_change(OldVsn, State, Extra) -> {ok, NewState}
  %% Description: Convert process state when code is changed
  %%--------------------------------------------------------------------
  code_change(_OldVsn, State, _Extra) ->
      {ok, State}.
  
  handle_info(tick, S) ->
      send_message(keep_alive, S, 0);
  handle_info(rate_update, S) ->
      Rate = etorrent_rate:update(S#state.rate, 0),
      ok = etorrent_rate_mgr:send_rate(S#state.torrent_id,
  
negative.code:     send_message(interested, S#state { interested = true });
  handle_cast({have, Pn}, S) ->
      send_message({have, Pn}, S);
  
  %% Cancels are handled specially when the fast extension is enabled.
  handle_cast({cancel, Idx, Offset, Len}, S) when S#state.fast_extension =:= true ->
      try
          NQ = etorrent_utils:queue_remove_check({Idx, Offset, Len},
                                                 S#state.requests),
          {noreply, S#state { requests = NQ}, 0}
      catch
          exit:badmatch -> {stop, normal, S}
      end;
  handle_cast({cancel, Index, OffSet, Len}, S) ->
      NQ = etorrent_utils:queue_remove({Index, OffSet, Len}, S#state.requests),
      {noreply, S#state{requests = NQ}, 0};
  
  handle_cast({local_request, {Index, Offset, Size}}, S) ->
      send_message({request, Index, Offset, Size}, S);
  handle_cast({remote_request, Idx, Offset, Len}, S)
  