diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-11-04 21:55:17 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-11-04 21:55:17 +0000 |
commit | 537ce23994d1f180a52d977213e8622e530aaf99 (patch) | |
tree | 9111832e203fad6dd03540ebf2c2d7266c18c92d /src/couchdb | |
parent | aa92e73811342ec1398dd77c92017520f9987715 (diff) |
Merged revision 1031276 from trunk:
Replicator: set Content-Length header when posting to _ensure_full_commit. Same reason as for COUCHDB-932.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1031279 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r-- | src/couchdb/couch_rep.erl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/couchdb/couch_rep.erl b/src/couchdb/couch_rep.erl index 28054f34..90b065c0 100644 --- a/src/couchdb/couch_rep.erl +++ b/src/couchdb/couch_rep.erl @@ -655,10 +655,15 @@ commit_to_both(Source, Target, RequiredSeq) -> {SourceStartTime, TargetStartTime}. ensure_full_commit(#http_db{headers = Headers} = Target) -> + Headers1 = [ + {"Content-Length", 0} | + couch_util:proplist_apply_field( + {"Content-Type", "application/json"}, Headers) + ], Req = Target#http_db{ resource = "_ensure_full_commit", method = post, - headers = couch_util:proplist_apply_field({"Content-Type", "application/json"}, Headers) + headers = Headers1 }, {ResultProps} = couch_rep_httpc:request(Req), true = couch_util:get_value(<<"ok">>, ResultProps), @@ -680,11 +685,16 @@ ensure_full_commit(Target) -> end. ensure_full_commit(#http_db{headers = Headers} = Source, RequiredSeq) -> + Headers1 = [ + {"Content-Length", 0} | + couch_util:proplist_apply_field( + {"Content-Type", "application/json"}, Headers) + ], Req = Source#http_db{ resource = "_ensure_full_commit", method = post, qs = [{seq, RequiredSeq}], - headers = couch_util:proplist_apply_field({"Content-Type", "application/json"}, Headers) + headers = Headers1 }, {ResultProps} = couch_rep_httpc:request(Req), case couch_util:get_value(<<"ok">>, ResultProps) of |