anchor.diff:      end.
   
   
  -perform_choke(S = #state { fast_extension = FX, choke = C}) ->
  -    case {FX, C} of
  -        {false, true} -> {noreply, S, 0};
  -        {false, false} ->
  -            ok = local_choke(S),
  -            send_message(choke, S#state{choke = true, requests = queue:new(),
  -                                        piece_cache = none});
  -        {true, true} -> {noreply, S, 0};
  -        {true, false} ->
  -            local_choke(S),
  -            {ok, NS} = send(choke, S),
  -            FS = empty_requests(NS),
  -            {noreply, FS, 0}
  -    end.
  +perform_choke(S) when S#state.fast_extension == true ->
  +    perform_fast_ext_choke(S);
  +perform_choke(S) when S#state.choke == true ->
  +    {noreply, S, 0};
  +perform_choke(S) ->
  +    local_choke(S),
  +    send_message(choke, S#state{choke = true, requests = queue:new(),
  +                                piece_cache = none}).
  +
  +perform_fast_ext_choke(S) when S#state.choke == true ->
  +    {noreply, S, 0};
  +perform_fast_ext_choke(S) ->
  +     local_choke(S),
  +     {ok, NS} = send(choke, S),
  +     FS = empty_requests(NS),
  +     {noreply, FS, 0}.
   
   empty_requests(S) ->
       empty_requests(queue:out(S#state.requests), S).
  
positive.code:     error_logger:info_report([got_unknown_message, Msg, S]),
      {stop, {unknown_msg, Msg}}.
  
  handle_cast(choke, S) ->
      perform_choke(S);
  handle_cast(unchoke, S) when S#state.choke == false ->
      {noreply, S, 0};
  handle_cast(unchoke, S) when S#state.choke == true ->
      ok = etorrent_rate_mgr:local_unchoke(S#state.torrent_id, S#state.parent),
      send_message(unchoke, S#state{choke = false});
  handle_cast(check_choke, S) when S#state.choke =:= true ->
      {noreply, S, 0};
  handle_cast(check_choke, S) when S#state.choke =:= false ->
      ok = etorrent_choker:perform_rechoke(),
      {noreply, S, 0};
  handle_cast({bitfield, BF}, S) ->
      send_message({bitfield, BF}, S);
  handle_cast(not_interested, S) when S#state.interested =:= false ->
  
negative.code: unchoke(Pid) ->
      gen_server:cast(Pid, unchoke).
  
  %% This call is used whenever we want to check the choke state of the peer.
  %% If it is true, we perform a rechoke request. It is probably the wrong
  %% place to issue the rechoke request. Rather, it would be better if a
  %% control process does this.
  check_choke(Pid) ->
      gen_server:cast(Pid, check_choke).
  
  %%--------------------------------------------------------------------
  %% Func: not_interested(Pid)
  