You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2015/07/22 20:33:54 UTC

couchdb-mango git commit: Match old behavior when buffering is disabled

Repository: couchdb-mango
Updated Branches:
  refs/heads/2724-chunked-buffering 20b8a051f -> 16b663eb1


Match old behavior when buffering is disabled

If the threshold is set to zero we make sure to send a separate chunk to
close the JSON, otherwise we just merge it into the previous chunk.


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

Branch: refs/heads/2724-chunked-buffering
Commit: 16b663eb1be15c41b38c3c5e3ad6a7cdce8bac74
Parents: 20b8a05
Author: Adam Kocoloski <ad...@cloudant.com>
Authored: Wed Jul 22 14:20:17 2015 -0400
Committer: Adam Kocoloski <ad...@cloudant.com>
Committed: Wed Jul 22 14:20:17 2015 -0400

----------------------------------------------------------------------
 src/mango_httpd.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/16b663eb/src/mango_httpd.erl
----------------------------------------------------------------------
diff --git a/src/mango_httpd.erl b/src/mango_httpd.erl
index 817506a..566ff09 100644
--- a/src/mango_httpd.erl
+++ b/src/mango_httpd.erl
@@ -222,8 +222,8 @@ start_find_resp(Req) ->
 
 
 end_find_resp(Acc0) ->
-    #vacc{resp=Resp00, buffer=Buf, kvs=KVs} = Acc0,
-    {ok, Resp0} = chttpd:send_delayed_chunk(Resp00, [Buf | "\r\n]"]),
+    #vacc{resp=Resp00, buffer=Buf, kvs=KVs, threshold=Max} = Acc0,
+    {ok, Resp0} = chttpd:close_delayed_json_object(Resp00, Buf, "\r\n]}", Max),
     FinalAcc = lists:foldl(fun({K, V}, Acc) ->
         JK = ?JSON_ENCODE(K),
         JV = ?JSON_ENCODE(V),