anchor.diff:  unchoke(Pid) ->
       gen_server:cast(Pid, unchoke).
   
  -%% @doc Tell the peer we have just received piece PieceNumber.
  -%% <p>The intended caller of this function is the {@link etorrent_piece_mgr}</p>
  -%% @end
  -have(Pid, PieceNumber) ->
  -    gen_server:cast(Pid, {have, PieceNumber}).
  -
  -%% @doc We got a chunk while in endgame mode, handle it.
  -%% <p>The logic is that the chunk may be queued up for this peer. We
  -%% wish to either cancel the request or remove it from the request
  -%% queue before it is sent out if possible.</p>
  -%% @end
  -cancel(Pid, Piece, Offset, Length) ->
  -    Chunk = {chunk, Piece, Offset, Length},
  -    gen_server:cast(Pid, {endgame_got_chunk, Chunk}).
  -
   %% @doc Initialize the connection.
   %% <p>The `Way' parameter tells the client of the connection is
   %% `incoming' or `outgoing'. They are handled differently since part
  
positive.code: -ignore_xref([{start_link, 6}]).
  
  %%====================================================================
  
  %% @doc Starts the server
  %% @end
  
negative.code: 
  
  %% @private
  handle_info({chunk, {fetched, Index, Offset, Length, _}}, State) ->
      #state{send_pid=SendPid, remote_request_set=Requests} = State,
      Hasrequest = etorrent_rqueue:member(Index, Offset, Length, Requests),
      NewRequests = if
          not Hasrequest ->
              Requests;
          Hasrequest ->
              etorrent_peer_send:cancel(SendPid, Index, Offset, Length),
              etorrent_rqueue:delete(Index, Offset, Length, Requests)
      end,
      NewState = State#state{remote_request_set=NewRequests},
      {noreply, NewState};
  
  handle_info({piece, {valid, Piece}}, State) ->
      #state{send_pid=SendPid} = State,
      etorrent_peer_send:have(SendPid, Piece),
      {noreply, State};
  
  handle_info({piece, {unassigned, _}}, State) ->
      {ok, NewState} = try_to_queue_up_pieces(State),
      {noreply, NewState};
  
  handle_info({download, Update}, State) ->
      #state{download=Download} = State,
      NewDownload = etorrent_download:update(Update, Download),
      NewState = State#state{download=NewDownload},
      {noreply, NewState};
  
  handle_info({tcp, _, _}, State) ->
      ?ERR([wrong_controller]),
      {noreply, State};
  
  handle_info(Info, State) ->
      ?WARN([unknown_msg, Info]),
      {noreply, State}.
  