couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From klaus_trai...@apache.org
Subject chttpd commit: updated refs/heads/master to a57e869
Date Wed, 04 Nov 2015 22:29:09 GMT
Repository: couchdb-chttpd
Updated Branches:
  refs/heads/master e5b1aee90 -> a57e86994


Fix return types of responses to view requests

This fixes an issue that was introduced with 72258e2 and e5b1aee.

Background:

Although all things still seemed to work, each request to a view
generated an exception with the following stack trace:

```
exception error: undefined function vacc:get/2
  in function  chttpd:result/2 (src/chttpd.erl, line 297)
  in call from chttpd:handle_request_int/1 (src/chttpd.erl, line 276)
  in call from mochiweb_http:headers/6 (src/mochiweb_http.erl, line 122)
```


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

Branch: refs/heads/master
Commit: a57e86994f6f5610edc3dca31ca373db92306d8b
Parents: e5b1aee
Author: Klaus Trainer <klaus_trainer@apache.org>
Authored: Mon Nov 2 23:12:04 2015 +0100
Committer: Klaus Trainer <klaus_trainer@apache.org>
Committed: Mon Nov 2 23:23:31 2015 +0100

----------------------------------------------------------------------
 src/chttpd_db.erl   | 3 ++-
 src/chttpd_view.erl | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/a57e8699/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 842593e..d4e29cb 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -618,7 +618,8 @@ all_docs_view(Req, Db, Keys, OP) ->
     Options = [{user_ctx, Req#httpd.user_ctx}],
     Max = chttpd:chunked_response_buffer_size(),
     VAcc = #vacc{db=Db, req=Req, threshold=Max},
-    fabric:all_docs(Db, Options, fun couch_mrview_http:view_cb/2, VAcc, Args3).
+    {ok, Resp} = fabric:all_docs(Db, Options, fun couch_mrview_http:view_cb/2, VAcc, Args3),
+    {ok, Resp#vacc.resp}.
 
 db_doc_req(#httpd{method='DELETE'}=Req, Db, DocId) ->
     % check for the existence of the doc to handle the 404 case.

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/a57e8699/src/chttpd_view.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_view.erl b/src/chttpd_view.erl
index ea86095..eccf290 100644
--- a/src/chttpd_view.erl
+++ b/src/chttpd_view.erl
@@ -33,14 +33,16 @@ multi_query_view(Req, Db, DDoc, ViewName, Queries) ->
         Acc1
     end, VAcc1, ArgQueries),
     {ok, Resp1} = chttpd:send_delayed_chunk(VAcc2#vacc.resp, "\r\n]}"),
-    chttpd:end_delayed_json_response(Resp1).
+    {ok, Resp2} = chttpd:end_delayed_json_response(Resp1),
+    {ok, Resp2#vacc.resp}.
 
 
 design_doc_view(Req, Db, DDoc, ViewName, Keys) ->
     Args = couch_mrview_http:parse_params(Req, Keys),
     Max = chttpd:chunked_response_buffer_size(),
     VAcc = #vacc{db=Db, req=Req, threshold=Max},
-    fabric:query_view(Db, DDoc, ViewName, fun couch_mrview_http:view_cb/2, VAcc, Args).
+    {ok, Resp} = fabric:query_view(Db, DDoc, ViewName, fun couch_mrview_http:view_cb/2, VAcc,
Args),
+    {ok, Resp#vacc.resp}.
 
 handle_view_req(#httpd{method='GET',
         path_parts=[_, _, _, _, ViewName]}=Req, Db, DDoc) ->


Mime
View raw message