descriptive name for the maximum number of dbs returned.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/88b11dba Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/88b11dba Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/88b11dba Branch: refs/heads/1960-paginate-all_dbs Commit: 88b11dbaa450b670bd43674fc76e9d5032b3978b Parents: f2b2f79 Author: Benoit Chesneau <[email protected]> Authored: Sun Jan 5 09:28:55 2014 +0100 Committer: Benoit Chesneau <[email protected]> Committed: Sun Jan 5 09:54:15 2014 +0100 ---------------------------------------------------------------------- src/couchdb/couch_httpd_misc_handlers.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/88b11dba/src/couchdb/couch_httpd_misc_handlers.erl ---------------------------------------------------------------------- diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl index 0d7fb2b..30ad488 100644 --- a/src/couchdb/couch_httpd_misc_handlers.erl +++ b/src/couchdb/couch_httpd_misc_handlers.erl @@ -28,7 +28,7 @@ start_chunked_response/3, send_error/4]). --define(DEFAULT_LIMIT, 16#10000000). +-define(MAX_DBS, 16#10000000). % httpd global handlers @@ -84,7 +84,7 @@ handle_utils_dir_req(Req, _) -> handle_all_dbs_req(#httpd{method='GET'}=Req) -> Limit0 = couch_util:to_integer(couch_httpd:qs_value(Req, "limit", - ?DEFAULT_LIMIT)), + ?MAX_DBS)), Skip0 = couch_util:to_integer(couch_httpd:qs_value(Req, "skip", -1)), {ok, {DbNames, _, _}} = couch_server:all_databases(fun all_dbs_fun/2, {[], Skip0, Limit0}), @@ -93,7 +93,7 @@ handle_all_dbs_req(Req) -> send_method_not_allowed(Req, "GET,HEAD"). -all_dbs_fun(DbName, {Acc, Skip, 0}) -> +all_dbs_fun(_DbName, {Acc, Skip, 0}) -> {stop, {Acc, Skip, 0}}; all_dbs_fun(DbName, {Acc, 0, Limit}) -> {ok, {[DbName | Acc], 0, Limit - 1}};
