anchor.diff:  %% ====================================================================
   
   maybe_reply({reply, Reply, State}) ->
  -    Request = State#state.pending,
  +    Request = State#state.active,
       NewRequest = send_caller(Reply, Request),
  -    State#state{pending = NewRequest};
  +    State#state{active = NewRequest};
   maybe_reply({noreply, State}) ->
       State.
   
  
positive.code: handle_info({tcp_closed, _Socket}, State) ->
      {noreply, disconnect(State)};
  
  handle_info({tcp, _Socket, Data}, State=#state{sock = Sock, pending = Pending}) ->
      [MsgCode|MsgData] = Data,
      Resp = riakc_pb:decode(MsgCode, MsgData),
      case Resp of
          #rpberrorresp{} ->
              NewState1 = maybe_reply(on_error(Pending, Resp, State)),
              NewState = dequeue_request(NewState1#state{pending = undefined});
          _ ->
              case process_response(Pending, 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(Pending#request.tref),
                      send_caller(Response, NewState0#state.pending),
                      NewState = dequeue_request(NewState0#state{pending = undefined});
  
                  {noreply, NewState0} ->
                      %% Request has completed with no reply needed, send the next request 
                      %% if one is queued up
                      cancel_req_timer(Pending#request.tref),
                      NewState = dequeue_request(NewState0#state{pending = undefined});
  
                  {pending, NewState0} -> %% Request is still pending - do not queue up a new one
                      NewPending = restart_req_timer(Pending),
                      NewState = NewState0#state{pending = NewPending}
              end
      end,
      inet:setopts(Sock, [{active, once}]),
      {noreply, NewState};
  handle_info({req_timeout, Ref}, State) ->
      case State#state.pending of %%
          undefined ->
              {noreply, remove_queued_request(Ref, State)};
          Pending ->
              case Ref == Pending#request.ref of
                  true ->  %% Matches the current operation
                      NewState = maybe_reply(on_timeout(State#state.pending, State)),
                      {noreply, disconnect(NewState#state{pending = undefined})};
                  false ->
                      {noreply, remove_queued_request(Ref, State)}
              end
  
negative.code: -record(state, {address,    % address to connect to
                  port,       % port to connect to
                  sock,       % gen_tcp socket
                  active,     % active request
                  queue,      % queue of pending requests
                  connects=0, % number of successful connects
                  failed=[],  % breakdown of failed connects
  