You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/09/14 19:42:48 UTC
couch-replicator commit: updated refs/heads/malformed-since to 6e96c2b
Repository: couchdb-couch-replicator
Updated Branches:
refs/heads/malformed-since [created] 6e96c2b9e
Encode seq before sending request
CouchDB 2.0 sequences are lists (of form [non_neg_integer(),
binary()]) where previously they were strings (either as binary or as
list) or numbers. The replicator calls iolist_to_binary on all
parameters which scrambles this new format.
Ensure we've JSON encoded the since value to a binary before calling send_req.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/commit/6e96c2b9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/6e96c2b9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/6e96c2b9
Branch: refs/heads/malformed-since
Commit: 6e96c2b9eb552d62ee52955226dacc487dc92d4b
Parents: a642119
Author: Robert Newson <rn...@apache.org>
Authored: Sun Sep 14 18:40:08 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Sun Sep 14 18:40:08 2014 +0100
----------------------------------------------------------------------
src/couch_replicator_api_wrap.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/6e96c2b9/src/couch_replicator_api_wrap.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_api_wrap.erl b/src/couch_replicator_api_wrap.erl
index ae4f16e..22a3b78 100644
--- a/src/couch_replicator_api_wrap.erl
+++ b/src/couch_replicator_api_wrap.erl
@@ -154,7 +154,7 @@ get_pending_count(#httpdb{} = Db, Seq) when is_number(Seq) ->
end
end);
get_pending_count(#httpdb{} = Db, Seq) ->
- Options = [{path, "_changes"}, {qs, [{"since", Seq}, {"limit", "0"}]}],
+ Options = [{path, "_changes"}, {qs, [{"since", ?JSON_ENCODE(Seq)}, {"limit", "0"}]}],
send_req(Db, Options, fun(200, _, {Props}) ->
{ok, couch_util:get_value(<<"pending">>, Props, null)}
end);