anchor.diff:          true ->
               accept
       end.
  +
  +combine_new_and_remainder_data(NewData, undefined) ->
  +    NewData;
  +combine_new_and_remainder_data(NewData, Remainder) ->
  +    <<Remainder/binary, NewData/binary>>.
  +
   
   %% @private
   %% @doc Break up a data binary into a list of block-sized chunks
  
positive.code:     case handle_chunk(CLength, NumBytesReceived, size(NewData),
                               CurrentBufferSize, MaxBufferSize) of
          accept ->
              handle_accept_chunk(State);
          backpressure ->
              handle_backpressure_for_chunk(State);
          last_chunk ->
              handle_receiving_last_chunk(State)
      end.
  
  all_received(finalize, _From, State) ->
  
negative.code:         [riak_moss_block_server:start_link() ||
              _ <- lists:seq(1, NumServers)]].
  
  handle_accept_chunk(NewData, State=#state{buffer_queue=BufferQueue,
                                            remainder_data=RemainderData,
                                            num_bytes_received=PreviousBytesReceived,
                                            content_length=ContentLength,
                                            free_writers=FreeWriters,
                                            unacked_writes=UnackedWrites}) ->
      NewRemainderData = combine_new_and_remainder_data(NewData, RemainderData),
      UpdatedBytesReceived = PreviousBytesReceived + size(NewData),
  
      {NewBufferQueue, NewRemainderData2} =
      data_blocks(NewRemainderData, ContentLength, UpdatedBytesReceived, BufferQueue),
  
      {NewBufferQueue2, NewFreeWriters, NewUnackedWrites} =
      maybe_write_block(NewBufferQueue, FreeWriters, UnackedWrites),
  
      Reply = ok,
      {reply, Reply, not_full, State#state{buffer_queue=NewBufferQueue2,
                                           free_writers=NewFreeWriters,
                                           unacked_writes=NewUnackedWrites,
                                           remainder_data=NewRemainderData2}}.
  
  %% pattern match on reply_pid=undefined as a sort of
  %% assert
  handle_backpressure_for_chunk(NewData, From, State=#state{reply_pid=undefined,
                                                            buffer_queue=BufferQueue,
                                                            remainder_data=RemainderData,
                                                            num_bytes_received=PreviousBytesReceived,
                                                            content_length=ContentLength,
                                                            free_writers=FreeWriters,
                                                            unacked_writes=UnackedWrites}) ->
      NewRemainderData = combine_new_and_remainder_data(NewData, RemainderData),
      UpdatedBytesReceived = PreviousBytesReceived + size(NewData),
  
      {NewBufferQueue, NewRemainderData2} =
      data_blocks(NewRemainderData, ContentLength, UpdatedBytesReceived, BufferQueue),
  
      {NewBufferQueue2, NewFreeWriters, NewUnackedWrites} =
      maybe_write_block(NewBufferQueue, FreeWriters, UnackedWrites),
  
      {noreply, full, State#state{reply_pid=From,
                                  buffer_queue=NewBufferQueue2,
                                  free_writers=NewFreeWriters,
                                  unacked_writes=NewUnackedWrites,
                                  remainder_data=NewRemainderData2}}.
  
  handle_receiving_last_chunk(_NewData, State=#state{}) ->
      %% 1. Maybe write another block
      Reply = ok,
      {reply, Reply, all_received, State}.
  