anchor.diff:      
   make_attachment_stub_receiver(Url, Headers, Name, Type, Length, Retries) ->
       %% start the process that receives attachment data from ibrowse
  -    Pid = spawn_link(fun() -> attachment_loop(nil) end),
  +    #url{host=Host, port=Port} = ibrowse_lib:parse_url(Url),
  +    {ok, Conn} = ibrowse:spawn_link_worker_process(Host, Port),
  +    Pid = spawn_link(fun() -> attachment_loop(nil, Conn) end),
       
       %% make the async request
  -    Options = [{stream_to, Pid}, {response_format, binary}],
  -    ReqId = case ibrowse:send_req(Url, Headers, get, [], Options, infinity) of
  +    Opts = [{stream_to, Pid}, {response_format, binary}],
  +    ReqId = 
  +    case ibrowse:send_req_direct(Conn, Url, Headers, get, [], Opts, infinity) of
           {ibrowse_req_id, X} -> X;
           {error, _Reason} -> exit(attachment_request_failed)
       end,
  
positive.code: 
  -export([replicate/2]).
  
  -include("couch_db.hrl").
  
  %% @spec replicate(Source::binary(), Target::binary()) -> 
  %%      {ok, Stats} | {error, Reason}
  
negative.code:     ets:update_counter(Stats, docs_read, length(Docs)),
      
      %% save them (maybe in a buffer)
      {NewBuffer, NewContext} = 
      case should_flush(lists:flatlength([Docs|Buffer])) of
          true ->
              Docs2 = lists:flatten([Docs|Buffer]),
              {ok, Errors} = update_docs(Target, Docs2, [], replicated_changes),
  