couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [01/49] chttpd commit: updated refs/heads/windsor-merge to 554ef74
Date Fri, 01 Aug 2014 09:05:37 GMT
Repository: couchdb-chttpd
Updated Branches:
  refs/heads/windsor-merge [created] 554ef7486


Honor "w" parameter for update handlers

BugzID: 17936


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/43a2e967
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/43a2e967
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/43a2e967

Branch: refs/heads/windsor-merge
Commit: 43a2e967b1815044ea743fb28a14ca07a8e0c5b8
Parents: 1ee2725
Author: Robert Newson <robert.newson@cloudant.com>
Authored: Sat Mar 9 15:45:40 2013 -0600
Committer: Robert Newson <rnewson@apache.org>
Committed: Tue Jul 29 17:10:23 2014 +0100

----------------------------------------------------------------------
 src/chttpd_show.erl | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/43a2e967/src/chttpd_show.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_show.erl b/src/chttpd_show.erl
index 58c88e6..9db4d07 100644
--- a/src/chttpd_show.erl
+++ b/src/chttpd_show.erl
@@ -118,13 +118,14 @@ send_doc_update_response(Req, Db, DDoc, UpdateName, Doc, DocId) ->
     JsonReq = chttpd_external:json_req_obj(Req, Db, DocId),
     JsonDoc = couch_query_servers:json_doc(Doc),
     Cmd = [<<"updates">>, UpdateName],
+    W = couch_httpd:qs_value(Req, "w", integer_to_list(mem3:quorum(Db))),
     case couch_query_servers:ddoc_prompt(DDoc, Cmd, [JsonDoc, JsonReq]) of
     [<<"up">>, {NewJsonDoc}, JsonResp] ->
         case chttpd:header_value(Req, "X-Couch-Full-Commit", "false") of
         "true" ->
-            Options = [full_commit, {user_ctx, Req#httpd.user_ctx}];
+            Options = [full_commit, {user_ctx, Req#httpd.user_ctx}, {w, W}];
         _ ->
-            Options = [{user_ctx, Req#httpd.user_ctx}]
+            Options = [{user_ctx, Req#httpd.user_ctx}, {w, W}]
         end,
         NewDoc = couch_doc:from_json_obj({NewJsonDoc}),
         case fabric:update_doc(Db, NewDoc, Options) of


Mime
View raw message