Allow runtime configuration of maximum url length in replication COUCHDB-2059
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/e1453abf Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/e1453abf Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/e1453abf Branch: refs/heads/2041-update-ibrowse Commit: e1453abf7d8075906abaf240d8f31465a94b6b25 Parents: 72adab9 Author: Robert Newson <[email protected]> Authored: Thu Feb 13 10:20:17 2014 +0000 Committer: Robert Newson <[email protected]> Committed: Thu Feb 13 10:20:17 2014 +0000 ---------------------------------------------------------------------- src/couch_replicator/src/couch_replicator_api_wrap.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/e1453abf/src/couch_replicator/src/couch_replicator_api_wrap.erl ---------------------------------------------------------------------- diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl b/src/couch_replicator/src/couch_replicator_api_wrap.erl index 52e15b7..5a42bb3 100644 --- a/src/couch_replicator/src/couch_replicator_api_wrap.erl +++ b/src/couch_replicator/src/couch_replicator_api_wrap.erl @@ -536,11 +536,11 @@ options_to_query_args([{open_revs, Revs} | Rest], Acc) -> options_to_query_args(Rest, [{"open_revs", JsonRevs} | Acc]). --define(MAX_URL_LEN, 7000). - atts_since_arg(_UrlLen, [], Acc) -> lists:reverse(Acc); atts_since_arg(UrlLen, [PA | Rest], Acc) -> + MaxUrlLen = list_to_integer( + couch_config:get("replicator", "max_url_len", "7000")), RevStr = couch_doc:rev_to_str(PA), NewUrlLen = case Rest of [] -> @@ -550,7 +550,7 @@ atts_since_arg(UrlLen, [PA | Rest], Acc) -> % plus 2 double quotes and a comma (% encoded) UrlLen + size(RevStr) + 9 end, - case NewUrlLen >= ?MAX_URL_LEN of + case NewUrlLen >= MaxUrlLen of true -> lists:reverse(Acc); false ->
