couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couch-replicator commit: updated refs/heads/master to 363093f
Date Mon, 15 Sep 2014 10:46:37 GMT
Repository: couchdb-couch-replicator
Updated Branches:
  refs/heads/master a6421192e -> 363093f48


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/363093f4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/363093f4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/363093f4

Branch: refs/heads/master
Commit: 363093f480fb5df6e337c9de308f0be9b31da783
Parents: a642119
Author: Robert Newson <rnewson@apache.org>
Authored: Sun Sep 14 18:40:08 2014 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Mon Sep 15 11:46:26 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/363093f4/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);


Mime
View raw message