anchor.diff:  
   %% @private
   %% Make a new request that can be sent or queued
  -new_request(Msg, From, _Timeout) ->
  -    #request{ref = make_ref(), msg = Msg, from = From}.
  -new_request(Msg, From, _Timeout, Context) ->
  -    #request{ref = make_ref(), msg = Msg, from = From, ctx = Context}.
  +new_request(Msg, From, Timeout) ->
  +    Ref = make_ref(),
  +    #request{ref = Ref, msg = Msg, from = From, timeout = Timeout,
  +             tref = create_req_timer(Timeout, Ref)}.
  +new_request(Msg, From, Timeout, Context) ->
  +    Ref = make_ref(),
  +    #request{ref =Ref, msg = Msg, from = From, ctx = Context, timeout = Timeout,
  +             tref = create_req_timer(Timeout, Ref)}.
  +
  +%% @private
  +%% Create a request timer if desired, otherwise return undefined.
  +create_req_timer(infinity, _Ref) ->
  +    undefined;
  +create_req_timer(undefined, _Ref) ->
  +    undefined;
  +create_req_timer(Msecs, Ref) ->
  +    erlang:send_after(Msecs, self(), {req_timeout, Ref}).
  +
  +%% @private
  +%% Cancel a request timer made by create_timer/2
  +cancel_req_timer(undefined) ->
  +    ok;
  +cancel_req_timer(Tref) ->
  +    erlang:cancel_timer(Tref),
  +    ok.
  +
  +%% @private
  +%% Restart a request timer
  +-spec restart_req_timer(#request{}) -> #request{}.
  +restart_req_timer(Request) ->
  +    case Request#request.tref of
  +        undefined ->
  +            Request;
  +        Tref ->
  +            cancel_req_timer(Tref),
  +            NewTref = create_req_timer(Request#request.timeout,
  +                                       Request#request.ref),
  +            Request#request{tref = NewTref}
  +    end.
  +
  +%% @private
  +%% Disconnect socket if connected
  +disconnect(State) ->
  +    case State#state.sock of
  +        undefined ->
  +            State;
  +        Sock ->
  +            gen_tcp:close(Sock),
  +            State#state{sock = undefined}
  +    end.    
   
   %% Send a request to the server and prepare the state for the response
   %% @private
  
positive.code:                  receive {2,Ping2} -> ?assertEqual(Ping2, pong) end
               end)},
  
       {"javascript_source_map_test()",
        ?_test(begin
                   reset_riak(),
  
negative.code: %% ====================================================================
  
  maybe_reply({reply, Reply, State}) ->
      Request = State#state.pending,
      NewRequest = send_caller(Reply, Request),
      State#state{pending = NewRequest};
  maybe_reply({noreply, State}) ->
      State.
  
  %% @private
  %% Reply to caller - form clause first in case a ReqId/Client was passed
  %% in as the context and gen_server:reply hasn't been called yet.
  send_caller(Msg, #request{ctx = {ReqId, Client}, 
                            from = undefined}=Request) ->
      Client ! {ReqId, Msg},
      Request;
  send_caller(Msg, #request{from = From}=Request) when From /= undefined ->
      gen_server:reply(From, Msg),
      Request#request{from = undefined}.
  
  default_timeout(_Op) ->
      60000.
  