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 45A9A10B22 for ; Tue, 16 Dec 2014 20:57:19 +0000 (UTC) Received: (qmail 84366 invoked by uid 500); 16 Dec 2014 20:57:19 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 84319 invoked by uid 500); 16 Dec 2014 20:57:19 -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 84264 invoked by uid 99); 16 Dec 2014 20:57:19 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Dec 2014 20:57:19 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id BBB3AA2D819; Tue, 16 Dec 2014 20:57:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davisp@apache.org To: commits@couchdb.apache.org Date: Tue, 16 Dec 2014 20:57:19 -0000 Message-Id: <7be3a9e27f4546e18640376e5f20bc2f@git.apache.org> In-Reply-To: <7c4c4a8174a242f89f8124456296481f@git.apache.org> References: <7c4c4a8174a242f89f8124456296481f@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] chttpd commit: updated refs/heads/master to c9d23bd Re-indent to reflect recent addtion of a case branch COUCHDB-2517 Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/c256e919 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/c256e919 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/c256e919 Branch: refs/heads/master Commit: c256e919220b298b7ab14074a68c1ff91bacf12a Parents: 016ede4 Author: ILYA Khlopotov Authored: Mon Dec 8 07:46:46 2014 -0800 Committer: ILYA Khlopotov Committed: Mon Dec 15 12:22:33 2014 -0800 ---------------------------------------------------------------------- src/chttpd_db.erl | 52 +++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/c256e919/src/chttpd_db.erl ---------------------------------------------------------------------- diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl index 79d832b..e4510ae 100644 --- a/src/chttpd_db.erl +++ b/src/chttpd_db.erl @@ -586,32 +586,32 @@ db_doc_req(#httpd{method='GET'}=Req, Db, DocId) -> [] when Revs == all -> chttpd:send_error(Req, {not_found, missing}); _Else -> - case lists:member("multipart/mixed", AcceptedTypes) of - false -> - {ok, Resp} = start_json_response(Req, 200), - send_chunk(Resp, "["), - % We loop through the docs. The first time through the separator - % is whitespace, then a comma on subsequent iterations. - lists:foldl( - fun(Result, AccSeparator) -> - case Result of - {ok, Doc} -> - JsonDoc = couch_doc:to_json_obj(Doc, Options), - Json = ?JSON_ENCODE({[{ok, JsonDoc}]}), - send_chunk(Resp, AccSeparator ++ Json); - {{not_found, missing}, RevId} -> - RevStr = couch_doc:rev_to_str(RevId), - Json = ?JSON_ENCODE({[{<<"missing">>, RevStr}]}), - send_chunk(Resp, AccSeparator ++ Json) - end, - "," % AccSeparator now has a comma - end, - "", Results), - send_chunk(Resp, "]"), - end_json_response(Resp); - true -> - send_docs_multipart(Req, Results, Options) - end + case lists:member("multipart/mixed", AcceptedTypes) of + false -> + {ok, Resp} = start_json_response(Req, 200), + send_chunk(Resp, "["), + % We loop through the docs. The first time through the separator + % is whitespace, then a comma on subsequent iterations. + lists:foldl( + fun(Result, AccSeparator) -> + case Result of + {ok, Doc} -> + JsonDoc = couch_doc:to_json_obj(Doc, Options), + Json = ?JSON_ENCODE({[{ok, JsonDoc}]}), + send_chunk(Resp, AccSeparator ++ Json); + {{not_found, missing}, RevId} -> + RevStr = couch_doc:rev_to_str(RevId), + Json = ?JSON_ENCODE({[{<<"missing">>, RevStr}]}), + send_chunk(Resp, AccSeparator ++ Json) + end, + "," % AccSeparator now has a comma + end, + "", Results), + send_chunk(Resp, "]"), + end_json_response(Resp); + true -> + send_docs_multipart(Req, Results, Options) + end end end;