couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject chttpd commit: updated refs/heads/2724-chunked-buffering to f6097cd
Date Mon, 20 Jul 2015 21:10:37 GMT
Repository: couchdb-chttpd
Updated Branches:
  refs/heads/2724-chunked-buffering f73ddafd0 -> f6097cdce


Guard against flushing an empty buffer

If the threshold is set below the size of an individual row we
effectively disable buffering. In that case we need to make sure not to
try and flush an empty buffer, as that's exactly the syntax for
terminating a chunked response.


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

Branch: refs/heads/2724-chunked-buffering
Commit: f6097cdce690a8597920cd3745d8450792da8c44
Parents: f73ddaf
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Mon Jul 20 17:10:10 2015 -0400
Committer: Adam Kocoloski <adam@cloudant.com>
Committed: Mon Jul 20 17:10:10 2015 -0400

----------------------------------------------------------------------
 src/chttpd_db.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/f6097cdc/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 4217d4a..b311552 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -218,7 +218,7 @@ changes_callback({error, Reason}, Acc) ->
     chttpd:send_delayed_error(Acc#cacc.mochi, Reason).
 
 maybe_flush_changes_feed(#cacc{bufsize=Size, threshold=Max} = Acc, Data, Len)
-         when (Size + Len) > Max ->
+         when Size > 0, (Size + Len) > Max ->
     #cacc{buffer = Buffer, mochi = Resp} = Acc,
     {ok, R1} = chttpd:send_delayed_chunk(Resp, Buffer),
     {ok, Acc#cacc{prepend = ",\r\n", buffer = Data, bufsize=Len, mochi = R1}};


Mime
View raw message