diff options
author | Robert Newson <robert.newson@cloudant.com> | 2014-02-13 10:20:17 +0000 |
---|---|---|
committer | Robert Newson <robert.newson@cloudant.com> | 2014-02-13 10:20:17 +0000 |
commit | e1453abf7d8075906abaf240d8f31465a94b6b25 (patch) | |
tree | 989a80d802983670eedf802c7825aa75d1a47d25 | |
parent | 72adab90471f107cfd4478d04ecb3b90e3f1d3f4 (diff) | |
download | couchdb-e1453abf7d8075906abaf240d8f31465a94b6b25.tar.gz |
Allow runtime configuration of maximum url length in replication
COUCHDB-2059
-rw-r--r-- | src/couch_replicator/src/couch_replicator_api_wrap.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/couch_replicator/src/couch_replicator_api_wrap.erl b/src/couch_replicator/src/couch_replicator_api_wrap.erl index 52e15b7fa..5a42bb31b 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 -> |