anchor.diff:              {error, Reason, S2}
       end;
   
  +run(put_file, _, _, #state{files=[]}) ->
  +    throw({stop, empty_keygen});
  +
  +run(put_file, _, _, State) ->
  +    {NextUrl, S2} = next_url(State),
  +    [File|RemainingFiles] = State#state.files,
  +    S3 = S2#state{files=RemainingFiles},
  +    Key = filename:basename(File),
  +    {ok, Val} = file:read_file(File),
  +    Url = url(NextUrl, Key, State#state.path_params),
  +    case do_put(Url, [State#state.client_id], Val) of
  +        ok -> {ok, S3};
  +        {error, Reason} -> {error, Reason, S3}
  +    end;
  +
  +run({search, {Qry, Expected}}, _, _, State) ->
  +    {NextUrl, S2} = next_url(State),
  +    SolrPath = State#state.solr_path,
  +    Encoded = mochiweb_util:urlencode([{q, Qry}, {wt, "json"}, {fl, "id"}]),
  +    SearchUrl = search_url(NextUrl, SolrPath, Encoded),
  +    %% ?INFO("URL: ~p~n", [SearchUrl]),
  +    Res = do_get(SearchUrl, [{body_on_success, true}]),
  +    case Res of
  +        {ok, _, _, Body} ->
  +            Struct = mochijson2:decode(Body),
  +            case check_numfound(Struct, Expected) of
  +                true ->
  +                    {ok, S2};
  +                {false, Actual} ->
  +                    {error, ?NOT_EXPECTED(Qry, Expected, Actual), S2}
  +            end;
  +        {error, Reason} ->
  +            {error, Reason, S2}
  +    end;
  +
   run(search, _KeyGen, _ValueGen, State) when State#state.searchgen == undefined ->
       {_NextUrl, S2} = next_url(State),
       {error, {badarg, "http_search_generator needed for search operation"}, S2};
  +
   run(search, _KeyGen, _ValueGen, State) ->
       %% Handle missing searchgen
       {NextUrl, S2} = next_url(State),
  
positive.code: -record(state, { client_id,          % Tuple client ID for HTTP requests
                   base_urls,          % Tuple of #url -- one for each IP
                   base_urls_index,    % #url to use for next request
                   path_params,        % Params to append on the path
                   solr_path,          % SOLR path for searches
                   searchgen }).       % Search generator
  
  
  %% ====================================================================
  
negative.code:     end.
  
  do_put(Url, Headers, ValueGen) ->
      Val = if is_function(ValueGen) ->
                    ValueGen();
               true ->
                    ValueGen
            end,
      case send_request(Url, Headers ++ [{'Content-Type', 'application/octet-stream'}],
                        put, Val, [{response_format, binary}]) of
          {ok, "204", _Header, _Body} ->
              ok;
          {ok, Code, _Header, _Body} ->
  