couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [04/11] git commit: Fix changes API usage for new pending values
Date Fri, 01 Aug 2014 12:06:05 GMT
Fix changes API usage for new pending values

BugzId: 26119


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

Branch: refs/heads/windsor-merge
Commit: f3b10d8e2521ddd7026e53bf5ed05451885be13f
Parents: 57d22d6
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Thu Dec 12 12:33:50 2013 -0600
Committer: Robert Newson <rnewson@apache.org>
Committed: Fri Aug 1 13:01:58 2014 +0100

----------------------------------------------------------------------
 src/global_changes_httpd.erl | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-global-changes/blob/f3b10d8e/src/global_changes_httpd.erl
----------------------------------------------------------------------
diff --git a/src/global_changes_httpd.erl b/src/global_changes_httpd.erl
index c05338b..a23b1e2 100644
--- a/src/global_changes_httpd.erl
+++ b/src/global_changes_httpd.erl
@@ -100,6 +100,9 @@ changes_callback({change, Change0}, #acc{feed="continuous"}=Acc) ->
             {ok, Acc#acc{resp=Resp1, last_data_sent_time=os:timestamp()}}
     end;
 changes_callback({stop, EndSeq}, #acc{feed="continuous"}=Acc) ->
+    % Temporary upgrade clause - Case 24236
+    changes_callback({stop, EndSeq, null}, Acc);
+changes_callback({stop, EndSeq, _Pending}, #acc{feed="continuous"}=Acc) ->
     #acc{resp=Resp} = Acc,
     {ok, Resp1} = chttpd:send_delayed_chunk(Resp,
         [?JSON_ENCODE({[{<<"last_seq">>, EndSeq}]}) | "\n"]),
@@ -135,6 +138,9 @@ changes_callback({change, Change0}, Acc) ->
             {ok, Acc1}
     end;
 changes_callback({stop, EndSeq}, Acc) ->
+    % Temporary upgrade clause - Case 24236
+    changes_callback({stop, EndSeq, null}, Acc);
+changes_callback({stop, EndSeq, _Pending}, Acc) ->
     #acc{resp=Resp} = Acc,
     {ok, Resp1} = chttpd:send_delayed_chunk(Resp,
         ["\n],\n\"last_seq\":", ?JSON_ENCODE(EndSeq), "}\n"]),


Mime
View raw message