couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject [6/9] chttpd commit: updated refs/heads/1843-feature-bigcouch-clustered-eventsource-changes-feed to 002a908
Date Wed, 28 May 2014 22:45:12 GMT
Pass context to all_docs


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

Branch: refs/heads/1843-feature-bigcouch-clustered-eventsource-changes-feed
Commit: 9e72ce81d20d29cab1b8db9b9bb0fd66d31c973d
Parents: 7c7c19f
Author: Robert Newson <rnewson@apache.org>
Authored: Tue May 27 13:12:31 2014 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Tue May 27 13:12:31 2014 +0100

----------------------------------------------------------------------
 src/chttpd_db.erl   | 6 ++++--
 src/chttpd_misc.erl | 3 ++-
 src/chttpd_show.erl | 3 ++-
 3 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/9e72ce81/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 0c08dd9..e77e2b7 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -484,9 +484,10 @@ all_docs_view(Req, Db, Keys) ->
         couch_mrview_http:check_view_etag(Sig, Acc0, Req)
     end,
     Args = Args0#mrargs{preflight_fun=ETagFun},
+    Options = [{user_ctx, Req#httpd.user_ctx}],
     {ok, Resp} = couch_httpd:etag_maybe(Req, fun() ->
         VAcc0 = #vacc{db=Db, req=Req},
-        fabric:all_docs(Db, fun couch_mrview_http:view_cb/2, VAcc0, Args)
+        fabric:all_docs(Db, Options, fun couch_mrview_http:view_cb/2, VAcc0, Args)
     end),
     case is_record(Resp, vacc) of
         true -> {ok, Resp#vacc.resp};
@@ -508,9 +509,10 @@ db_doc_req(#httpd{method='GET'}=Req, Db, DocId) ->
     #doc_query_args{
         rev = Rev,
         open_revs = Revs,
-        options = Options,
+        options = Options0,
         atts_since = AttsSince
     } = parse_doc_query(Req),
+    Options = [{user_ctx, Req#httpd.user_ctx} | Options0],
     case Revs of
     [] ->
         Options2 =

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/9e72ce81/src/chttpd_misc.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_misc.erl b/src/chttpd_misc.erl
index 5e476e9..9a1189f 100644
--- a/src/chttpd_misc.erl
+++ b/src/chttpd_misc.erl
@@ -95,10 +95,11 @@ handle_all_dbs_req(#httpd{method='GET'}=Req) ->
     %% so it can be pushed thru fabric
     {ok, Info} = fabric:get_db_info(ShardDbName),
     Etag = couch_httpd:make_etag({Info}),
+    Options = [{user_ctx, Req#httpd.user_ctx}],
     {ok, Resp} = chttpd:etag_respond(Req, Etag, fun() ->
         {ok, Resp} = chttpd:start_delayed_json_response(Req, 200, [{"Etag",Etag}]),
         VAcc = #vacc{req=Req,resp=Resp},
-        fabric:all_docs(ShardDbName, fun all_dbs_callback/2, VAcc, Args)
+        fabric:all_docs(ShardDbName, Options, fun all_dbs_callback/2, VAcc, Args)
     end),
     case is_record(Resp, vacc) of
         true -> {ok, Resp#vacc.resp};

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/9e72ce81/src/chttpd_show.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_show.erl b/src/chttpd_show.erl
index 54a2007..58c88e6 100644
--- a/src/chttpd_show.erl
+++ b/src/chttpd_show.erl
@@ -185,6 +185,7 @@ handle_view_list(Req, Db, DDoc, LName, {ViewDesignName, ViewName}, Keys)
->
     CB = fun couch_mrview_show:list_cb/2,
     Etag = couch_uuids:new(),
     QueryArgs = couch_mrview_http:parse_params(Req, Keys),
+    Options = [{user_ctx, Req#httpd.user_ctx}],
     chttpd:etag_respond(Req, Etag, fun() ->
         couch_query_servers:with_ddoc_proc(DDoc, fun(QServer) ->
             Acc = #lacc{
@@ -196,7 +197,7 @@ handle_view_list(Req, Db, DDoc, LName, {ViewDesignName, ViewName}, Keys)
->
             },
             case ViewName of
                 <<"_all_docs">> ->
-                    fabric:all_docs(Db, CB, Acc, QueryArgs);
+                    fabric:all_docs(Db, Options, CB, Acc, QueryArgs);
                 _ ->
                     fabric:query_view(Db, VDoc, ViewName, CB, Acc, QueryArgs)
             end


Mime
View raw message