anchor.diff:      {ok, Resp} = chttpd:start_delayed_json_response(Req, 200, [], FirstChunk),
       {ok, Acc#cacc{mochi = Resp, responding = true}};
   changes_callback({change, Change}, Acc) ->
  -    #cacc{prepend = Prepend, mochi = Resp} = Acc,
  -    {ok, Resp1} = chttpd:send_delayed_chunk(Resp, [Prepend, ?JSON_ENCODE(Change)]),
  -    {ok, Acc#cacc{prepend = ",\r\n", mochi = Resp1}};
  +    Data = [Acc#cacc.prepend, ?JSON_ENCODE(Change)],
  +    Len = iolist_size(Data),
  +    maybe_flush_changes_feed(Acc, Data, Len);
   changes_callback({stop, EndSeq, Pending}, Acc) ->
  -    #cacc{mochi = Resp} = Acc,
  +    #cacc{buffer = Buf, mochi = Resp} = Acc,
       {ok, Resp1} = case is_old_couch(Resp) of
       true ->
  -        chttpd:send_delayed_chunk(Resp, "\n],\n\"last_seq\":0}\n");
  +        chttpd:send_delayed_chunk(Resp, [Buf | "\n],\n\"last_seq\":0}\n"]);
       false ->
           chttpd:send_delayed_chunk(Resp, [
  +            Buf,
               "\n],\n\"last_seq\":",
               ?JSON_ENCODE(EndSeq),
               ",\"pending\":",
  
positive.code:         DeltaT = timer:now_diff(os:timestamp(), T0) / 1000,
          couch_stats:update_histogram([couchdb, dbinfo], DeltaT),
          chttpd:etag_respond(Req, Etag, fun() ->
              Acc0 = #cacc{feed = normal, etag = Etag, mochi = Req},
              fabric:changes(Db, fun changes_callback/2, Acc0, ChangesArgs)
          end);
      Feed when Feed =:= "continuous"; Feed =:= "longpoll"; Feed =:= "eventsource"  ->
          couch_stats:increment_counter([couchdb, httpd, clients_requesting_changes]),
          Acc0 = #cacc{feed = list_to_atom(Feed), mochi = Req},
          try
              fabric:changes(Db, fun changes_callback/2, Acc0, ChangesArgs)
          after
  
negative.code:     feed,
      mochi,
      prepend = "",
      responding = false,
      buffer = [],
      bufsize = 0,
      threshold
  }).
  
  -define(IS_ALL_DOCS(T), (
  