anchor.diff:              end
       end.
   
  -do_put(Host, Url, Headers, Value) ->
  +do_put(Host, Url, Headers, Value, ReportFun) ->
       case send_request(Host, Url, Headers ++ [{'Content-Type', 'application/octet-stream'}],
                         put, Value, proxy_opts()) of
           {ok, "201", _Header, _Body} ->
  -            ok;
  +            {ok, ReportFun(byte_size(Value))};
           {ok, "204", _Header, _Body} ->
  -            ok;
  +            {ok, ReportFun(byte_size(Value))};
           {ok, Code, _Header, _Body} ->
               {error, {http_error, Code}};
           {error, Reason} ->
  
positive.code:     Disconnect = basho_bench_config:get(moss_disconnect_frequency, infinity),
      erlang:put(disconnect_freq, Disconnect),
  
      Hosts = [{Ip, Port}],
  
      {ok, #state{client_id=ID, hosts=Hosts,
                  bucket = basho_bench_config:get(moss_bucket, "test")}}.
  
  -spec run(atom(), fun(), fun(), term()) -> {ok, term()}.
  run(insert, KeyGen, ValueGen, #state{bucket = Bucket} = State) ->
      {NextHost, S2} = next_host(State),
      ConnInfo = NextHost,
      case insert(KeyGen, ValueGen, ConnInfo, Bucket) of
          ok ->
              {ok, S2};
          {Error, Reason} ->
              {Error, Reason, S2}
      end;
  run(update, KeyGen, ValueGen, #state{bucket = Bucket} = State) ->
      {NextHost, S2} = next_host(State),
      {Host, Port} = NextHost,
      Key = KeyGen(),
      Url = url(Host, Port, Bucket, Key),
      case do_get({Host, Port}, Url, []) of
          ok ->
              case insert(KeyGen, ValueGen, {Host, Port}, Bucket) of
                  ok ->
                      {ok, State};
                  {Error, Reason} ->
                      {Error, Reason, S2}
              end;
  
negative.code:         {Error, Reason} ->
              {Error, Reason, S2}
      end;
  run(get, KeyGen, _ValueGen, #state{bucket = Bucket,
                                     report_fun = ReportFun} = State) ->
      {NextHost, S2} = next_host(State),
      {Host, Port} = NextHost,
      Key = KeyGen(),
      Url = url(Host, Port, Bucket, Key),
      case do_get({Host, Port}, Url, [], ReportFun) of
          {ok, _Size} = Good ->
              {Good, S2};
          {Error, Reason} ->
              {Error, Reason, S2}
      end;
  run(Op, _KeyGen, _ValueGen, State) ->
      {error, {unknown_op, Op}, State}.
  
  %% ====================================================================
  %% Internal functions
  %% ====================================================================
  
  insert(KeyGen, ValueGen, {Host, Port}, Bucket, ReportFun) ->
      Key = KeyGen(),
      Url = url(Host, Port, Bucket, Key),
      Value = ValueGen(),
      do_put({Host, Port}, Url, [], Value, ReportFun).
  
  url(Host, Port, Bucket, Key) ->
      UnparsedUrl = lists:concat(["http://", Host, ":", Port, "/", Bucket, "/", Key]),
  