Fix limit=N for non-admins by counting post-filter
authorBenjamin Bastian <benjamin.bastian@gmail.com>
Tue, 10 Dec 2013 21:50:00 +0000 (13:50 -0800)
committerRobert Newson <rnewson@apache.org>
Thu, 7 Aug 2014 16:00:36 +0000 (17:00 +0100)
commitd58fce19e855072634d4bcfacfeaab7d2c93f0b4
treef0b7d7316cd4c52113c5eccb778a7ecc82baa928
parent1895630795efdc6091f0b5b805cd630e442493bf
Fix limit=N for non-admins by counting post-filter

Prior to this commit, the _db_updates endpoint would often return less
than N results for limit=N queries, even when there were N changes to
return. This was because the limiting was done by passing the limit
parameter to fabric:changes, which doesn't account for the per-user
filtering done in global_changes_httpd.

This commit adds explicit counting of the filtered changes in
global_changes_httpd and manually ends the request when N post-filter
changes have been seen.

BugzID: 25272
src/global_changes_httpd.erl