anchor.diff:          [Id, couch_doc:rev_to_str(Rev), Error]),
       dump_update_errors(Rest).
   
  -attachment_loop(ReqId) ->
  +attachment_loop(ReqId, Conn) ->
       couch_util:should_flush(),
       receive 
           {From, {set_req_id, NewId}} ->
               %% we learn the ReqId to listen for
               From ! {self(), {ok, NewId}},
  -            attachment_loop(NewId);
  +            attachment_loop(NewId, Conn);
           {ibrowse_async_headers, ReqId, Status, Headers} ->
               %% we got header, give the controlling process a chance to react
               receive 
  
positive.code:     ets:update_counter(State#state.stats, total_revs, RevsCount),
      case State#state.listeners of
      [] ->
          % still waiting for the first listener to sen a request
          {noreply, State#state{current_seq=LastSeq,done=true}};
      _ ->
          {stop, normal, ok, State#state{current_seq=LastSeq}}
  
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),
  