anchor.diff:  
   %% Send a request to the server and prepare the state for the response
   %% @private
  -send_request(Request, State) when State#state.pending =:= undefined ->
  +send_request(Request, State) when State#state.active =:= undefined ->
       Pkt = riakc_pb:encode(Request#request.msg),
       gen_tcp:send(State#state.sock, Pkt),
  -    maybe_reply(after_send(Request, State#state{pending = Request})).
  +    maybe_reply(after_send(Request, State#state{active = Request})).
   
   %% Queue up a request if one is pending
   %% @private
  -queue_request(Pending, State) ->
  -    State#state{queue = queue:in(Pending, State#state.queue)}.
  +queue_request(Request, State) ->
  +    State#state{queue = queue:in(Request, State#state.queue)}.
   
   %% Try and dequeue request and send onto the server if one is waiting
   %% @private
  
positive.code: -record(state, {address,    % address to connect to
                  port,       % port to connect to
                  sock,       % gen_tcp socket
                  pending,    % active request
                  queue,      % queue of pending requests
                  connects=0, % number of successful connects
                  failed=[],  % breakdown of failed connects
  
negative.code: handle_info({tcp_closed, _Socket}, State) ->
      {noreply, disconnect(State)};
  
  handle_info({tcp, _Socket, Data}, State=#state{sock = Sock, active = Active}) ->
      [MsgCode|MsgData] = Data,
      Resp = riakc_pb:decode(MsgCode, MsgData),
      case Resp of
          #rpberrorresp{} ->
              NewState1 = maybe_reply(on_error(Active, Resp, State)),
              NewState = dequeue_request(NewState1#state{active = undefined});
          _ ->
              case process_response(Active, Resp, State) of
                  {reply, Response, NewState0} ->
                      %% Send reply and get ready for the next request - send the next request
                      %% if one is queued up
                      cancel_req_timer(Active#request.tref),
                      send_caller(Response, NewState0#state.active),
                      NewState = dequeue_request(NewState0#state{active = undefined});
  
                  {noreply, NewState0} ->
                      %% Request has completed with no reply needed, send the next request 
                      %% if one is queued up
                      cancel_req_timer(Active#request.tref),
                      NewState = dequeue_request(NewState0#state{active = undefined});
  
                  {pending, NewState0} -> %% Request is still pending - do not queue up a new one
                      NewActive = restart_req_timer(Active),
                      NewState = NewState0#state{active = NewActive}
              end
      end,
      inet:setopts(Sock, [{active, once}]),
      {noreply, NewState};
  handle_info({req_timeout, Ref}, State) ->
      case State#state.active of %%
          undefined ->
              {noreply, remove_queued_request(Ref, State)};
          Active ->
              case Ref == Active#request.ref of
                  true ->  %% Matches the current operation
                      NewState = maybe_reply(on_timeout(State#state.active, State)),
                      {noreply, disconnect(NewState#state{active = undefined})};
                  false ->
                      {noreply, remove_queued_request(Ref, State)}
              end
  