anchor.diff:      NewState = State#state{peer_monitors=NewPeers},
       {reply, ok, NewState};
   
  -handle_call({mark_dropped, Pid, Index, Offset, Length}, _, State) ->
  +
  +
  +handle_call({mark_all_dropped, Pid}, _, State) ->
  +    %% When marking all requests as dropped, send a series of
  +    %% mark_dropped-messages to ourselves. The state of each
  +    %% piece should be restored eventually.
  +    #state{peer_monitors=Peers} = State,
  +
  +    %% Add the chunks back to the chunkset of each piece.
  +    OpenReqs = etorrent_monitorset:fetch(Pid, Peers),
  +    _ = [begin
  +        cast(self(), {mark_dropped, Pid, Index, Offset, Length})
  +    end || {Index, Offset, Length} <- chunk_list(OpenReqs)],
  +    {reply, ok, State}.
  +
  +handle_cast({mark_dropped, Pid, Index, Offset, Length}, State) ->
       #state{
           pieces_assigned=Assigned,
           chunks_assigned=AssignedChunks,
  
positive.code:          pieces_assigned=NewAssigned,
           chunks_assigned=NewAssignedChunks,
           peer_monitors=NewPeers},
      {reply, ok, NewState};
  
  handle_call({mark_all_dropped, Pid}, _, State) ->
      #state{
          pieces_assigned=Assigned,
          chunks_assigned=PieceChunks,
          peer_monitors=Peers} = State,
      %% Add the chunks back to the chunkset of each piece.
      OpenReqs = etorrent_monitorset:fetch(Pid, Peers),
      NewPieceChunks = lists:foldl(fun({Index, Offset, Length}, Acc) ->
          insert_chunk(Index, Offset, Length, Acc)
      end, PieceChunks, chunk_list(OpenReqs)),
  
      %% None of the pieces that had open requests are no longer assigned
      NewAssigned = lists:foldl(fun({Index, _, _}, Acc) ->
          etorrent_pieceset:delete(Index, Acc)
      end, Assigned, chunk_list(OpenReqs)),
  
      %% Replace the peer's set of open requests with an empty set
      NewPeers = etorrent_monitorset:update(Pid, gb_trees:empty(), Peers),
      NewState = State#state{
          pieces_assigned=NewAssigned,
          chunks_assigned=NewPieceChunks,
          peer_monitors=NewPeers},
      {reply, ok, NewState}.
  
  
  
  handle_cast(_, _) ->
      not_implemented.
  
  handle_info({'DOWN', _, process, Pid, _}, State) ->
      #state{
          pieces_assigned=Assigned,
          chunks_assigned=PieceChunks,
          peer_monitors=Peers} = State,
      %% Add the chunks back to the chunkset of each piece.
      OpenReqs = etorrent_monitorset:fetch(Pid, Peers),
      NewPieceChunks = lists:foldl(fun({PieceIndex, Offset, Length}, Acc) ->
          insert_chunk(PieceIndex, Offset, Length, Acc)
      end, PieceChunks, chunk_list(OpenReqs)),
  
      %% None of the pieces that had open requests are no longer assigned
      NewAssigned = lists:foldl(fun({Index, _, _}, Acc) ->
          etorrent_pieceset:delete(Index, Acc)
      end, Assigned, chunk_list(OpenReqs)),
  
      %% Delete the peer from the set of monitored peers
      NewPeers = etorrent_monitorset:delete(Pid, Peers),
      NewState = State#state{
          pieces_assigned=NewAssigned,
          chunks_assigned=NewPieceChunks,
          peer_monitors=NewPeers},
      {noreply, NewState}.
  
  %% @private
  terminate(_Reason, _State) ->
  
negative.code:     end),
      Ref = monitor(process, Pid),
      ok  = receive {'DOWN', _, process, Pid, _} -> ok end,
      timer:sleep(10),
      ?assertMatch({ok, [{0, 0, 1}]}, ?chunk_server:request_chunks(10, Has, 1)).
  
  
  