anchor.diff:              % send the etag
               {ok, Resp} = start_json_response(Req, 200, [{"Etag", CurrentEtag}]),
               start_sending_changes(Resp, ResponseType),
  -            {ok, {_, LastSeq, _Prepend, _, _, _, _}} =
  +            {ok, {_, LastSeq, _Prepend, _, _, _, _, _}} =
                       send_changes(Req, Resp, Db, Dir, StartSeq, <<"">>, "normal",
  -                        FilterFun, EndFilterFun),
  +                        Limit, FilterFun, EndFilterFun),
               end_sending_changes(Resp, LastSeq, ResponseType)
           end)
       end;
  
positive.code:         updated ->
              {ok, Db2} = couch_db:open(DbName, [{user_ctx, UserCtx}]),
              keep_sending_changes(Req, Resp, Db2, EndSeq, Prepend2, Timeout,
                  TimeoutFun, ResponseType, Filter, End);
          stop ->
              end_sending_changes(Resp, EndSeq, ResponseType)
          end
      end.
  
  changes_enumerator(DocInfos, {Db, _, _, FilterFun, Resp, "continuous", IncludeDocs}) ->
      [#doc_info{id=Id, high_seq=Seq, revs=[#rev_info{deleted=Del,rev=Rev}|_]}|_] = DocInfos,
      Results0 = [FilterFun(DocInfo) || DocInfo <- DocInfos],
      Results = [Result || Result <- Results0, Result /= null],
      case Results of
      [] ->
          {ok, {Db, Seq, nil, FilterFun, Resp, "continuous", IncludeDocs}};
      _ ->
          send_chunk(Resp, [?JSON_ENCODE(changes_row(Db, Seq, Id, Del, Results, Rev, IncludeDocs))
              |"\n"]),
          {ok, {Db, Seq, nil, FilterFun, Resp, "continuous", IncludeDocs}}
      end;
  changes_enumerator(DocInfos, {Db, _, Prepend, FilterFun, Resp, _, IncludeDocs}) ->
      [#doc_info{id=Id, high_seq=Seq, revs=[#rev_info{deleted=Del,rev=Rev}|_]}|_] = DocInfos,
      Results0 = [FilterFun(DocInfo) || DocInfo <- DocInfos],
      Results = [Result || Result <- Results0, Result /= null],
      case Results of
      [] ->
          {ok, {Db, Seq, Prepend, FilterFun, Resp, nil, IncludeDocs}};
      _ ->
          send_chunk(Resp, [Prepend, ?JSON_ENCODE(
              changes_row(Db, Seq, Id, Del, Results, Rev, IncludeDocs))]),
          {ok, {Db, Seq, <<",\n">>, FilterFun, Resp, nil, IncludeDocs}}
      end.
  
  changes_row(Db, Seq, Id, Del, Results, Rev, true) ->
  
negative.code:     end_json_response(Resp).
  
  keep_sending_changes(#httpd{user_ctx=UserCtx,path_parts=[DbName|_]}=Req, Resp,
          Db, StartSeq, Prepend, Timeout, TimeoutFun, ResponseType, Limit, Filter, End) ->
      {ok, {_, EndSeq, Prepend2, _, _, _, NewLimit, _}} = send_changes(Req, Resp, Db, fwd, StartSeq,
          Prepend, ResponseType, Limit, Filter, End),
      couch_db:close(Db),
      if
      EndSeq > StartSeq, ResponseType == "longpoll" ->
  