Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6D49511AAF for ; Thu, 28 Aug 2014 11:59:30 +0000 (UTC) Received: (qmail 73809 invoked by uid 500); 28 Aug 2014 11:59:25 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 73659 invoked by uid 500); 28 Aug 2014 11:59:25 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 73446 invoked by uid 99); 28 Aug 2014 11:59:25 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Aug 2014 11:59:25 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 07AA4A02AB1; Thu, 28 Aug 2014 11:59:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rnewson@apache.org To: commits@couchdb.apache.org Date: Thu, 28 Aug 2014 11:59:27 -0000 Message-Id: <1fb7def6db8d417eb83c8d73cc4de56a@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [04/50] chttpd commit: updated refs/heads/master to 58020ab Allow write quorum control in POST body BugzID: 18457 Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/c90a4c0f Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/c90a4c0f Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/c90a4c0f Branch: refs/heads/master Commit: c90a4c0f602696fa6b6ccf9eda9ed5b5655488bc Parents: 31b7d4a Author: Adam Kocoloski Authored: Wed Apr 10 12:24:13 2013 -0400 Committer: Robert Newson Committed: Tue Jul 29 17:12:18 2014 +0100 ---------------------------------------------------------------------- src/chttpd_db.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/c90a4c0f/src/chttpd_db.erl ---------------------------------------------------------------------- diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl index eff1cbf..18a1078 100644 --- a/src/chttpd_db.erl +++ b/src/chttpd_db.erl @@ -301,7 +301,12 @@ db_req(#httpd{method='POST',path_parts=[_,<<"_bulk_docs">>], user_ctx=Ctx}=Req, couch_httpd:validate_ctype(Req, "application/json"), {JsonProps} = chttpd:json_body_obj(Req), DocsArray = couch_util:get_value(<<"docs">>, JsonProps), - W = couch_httpd:qs_value(Req, "w", integer_to_list(mem3:quorum(Db))), + W = case couch_util:get_value(<<"w">>, JsonProps) of + Value when is_integer(Value) -> + Value; + _ -> + couch_httpd:qs_value(Req, "w", integer_to_list(mem3:quorum(Db))) + end, case chttpd:header_value(Req, "X-Couch-Full-Commit") of "true" -> Options = [full_commit, {user_ctx,Ctx}, {w,W}];