From 7ae8cc653381805896e57514e9a3dabe8bffc522 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Thu, 4 Nov 2010 21:53:50 +0000 Subject: 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/trunk@1031276 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_rep.erl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/couchdb/couch_rep.erl b/src/couchdb/couch_rep.erl index ea9a3301..88912fbf 100644 --- a/src/couchdb/couch_rep.erl +++ b/src/couchdb/couch_rep.erl @@ -739,10 +739,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), @@ -764,11 +769,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 -- cgit v1.2.3