couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject [6/7] chttpd commit: updated refs/heads/2724-chunked-buffering to 45bb534
Date Wed, 22 Jul 2015 21:01:27 GMT
Remove support for CouchDB =< 1.0.0

Thise UA-sniffing code has been in place to ensure interop with clients
running CouchDB versions older than 1.0.1. We should be safe to remove
it now.


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

Branch: refs/heads/2724-chunked-buffering
Commit: 4278115947305a6d505bfe91d098840dd5ba8755
Parents: 5069427
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Wed Jul 22 14:10:43 2015 -0400
Committer: Adam Kocoloski <adam@cloudant.com>
Committed: Wed Jul 22 16:57:49 2015 -0400

----------------------------------------------------------------------
 src/chttpd_db.erl | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/42781159/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 329217a..b4b4a83 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -128,9 +128,8 @@ changes_callback({change, Change}, #cacc{feed = continuous} = Acc) ->
     Data = [?JSON_ENCODE(Change) | "\n"],
     Len = iolist_size(Data),
     maybe_flush_changes_feed(Acc, Data, Len);
-changes_callback({stop, EndSeq0, Pending}, #cacc{feed = continuous} = Acc) ->
+changes_callback({stop, EndSeq, Pending}, #cacc{feed = continuous} = Acc) ->
     #cacc{mochi = Resp, buffer = Buf} = Acc,
-    EndSeq = case is_old_couch(Resp) of true -> 0; false -> EndSeq0 end,
     Row = {[
         {<<"last_seq">>, EndSeq},
         {<<"pending">>, Pending}
@@ -185,11 +184,7 @@ changes_callback({change, Change}, Acc) ->
     maybe_flush_changes_feed(Acc, Data, Len);
 changes_callback({stop, EndSeq, Pending}, Acc) ->
     #cacc{buffer = Buf, mochi = Resp} = Acc,
-    {ok, Resp1} = case is_old_couch(Resp) of
-    true ->
-        chttpd:send_delayed_chunk(Resp, [Buf | "\n],\n\"last_seq\":0}\n"]);
-    false ->
-        chttpd:send_delayed_chunk(Resp, [
+    {ok, Resp1} = chttpd:send_delayed_chunk(Resp, [
             Buf,
             "\n],\n\"last_seq\":",
             ?JSON_ENCODE(EndSeq),
@@ -230,17 +225,6 @@ maybe_flush_changes_feed(Acc0, Data, Len) ->
     },
     {ok, Acc}.
 
-is_old_couch(Resp) ->
-    MochiReq = chttpd:get_delayed_req(Resp),
-    case MochiReq:get_header_value("user-agent") of
-    undefined ->
-        false;
-    "CouchDB/1.0.0" ->
-        true;
-    UserAgent ->
-        string:str(UserAgent, "CouchDB/0") > 0
-    end.
-
 handle_compact_req(Req, _) ->
     Msg = <<"Compaction must be triggered on a per-shard basis in CouchDB">>,
     couch_httpd:send_error(Req, 403, forbidden, Msg).


Mime
View raw message