anchor.diff:      chttpd:end_delayed_json_response(Resp1);
   
   % callbacks for eventsource feed (newline-delimited eventsource Objects)
  -changes_callback(start, {"eventsource", Req}) ->
  +changes_callback(start, #cacc{feed = eventsource} = Acc) ->
  +    #cacc{mochi = Req} = Acc,
       Headers = [
           {"Content-Type", "text/event-stream"},
           {"Cache-Control", "no-cache"}
       ],
       {ok, Resp} = chttpd:start_delayed_json_response(Req, 200, Headers),
  -    {ok, {"eventsource", Resp}};
  -changes_callback({change, {ChangeProp}=Change}, {"eventsource", Resp}) ->
  +    {ok, Acc#cacc{mochi = Resp, responding = true}};
  +changes_callback({change, {ChangeProp}=Change}, #cacc{feed = eventsource} = Acc) ->
  +    #cacc{mochi = Resp} = Acc,
       Seq = proplists:get_value(seq, ChangeProp),
       Chunk = [
           "data: ", ?JSON_ENCODE(Change),
  
positive.code:     end,
      chttpd:end_delayed_json_response(Resp1);
  
  changes_callback(timeout, {Prepend, Resp}) ->
      {ok, Resp1} = chttpd:send_delayed_chunk(Resp, "\n"),
      {ok, {Prepend, Resp1}};
  changes_callback({error, Reason}, {_, #httpd{}=Req}) ->
      chttpd:send_error(Req, Reason);
  changes_callback({error, Reason}, {"normal", {"Etag", _Etag}, Req}) ->
      chttpd:send_error(Req, Reason);
  changes_callback({error, Reason}, {_, Resp}) ->
      chttpd:send_delayed_error(Resp, Reason).
  
  is_old_couch(Resp) ->
      MochiReq = chttpd:get_delayed_req(Resp),
  
negative.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
              couch_stats:decrement_counter([couchdb, httpd, clients_requesting_changes])
          end;
  