couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r820851 - in /couchdb/trunk/src/couchdb: couch_rep_changes_feed.erl couch_rep_reader.erl
Date Fri, 02 Oct 2009 00:27:49 GMT
Author: kocolosk
Date: Fri Oct  2 00:27:48 2009
New Revision: 820851

URL: http://svn.apache.org/viewvc?rev=820851&view=rev
Log:
replication bugfixes, see COUCHDB-516

Modified:
    couchdb/trunk/src/couchdb/couch_rep_changes_feed.erl
    couchdb/trunk/src/couchdb/couch_rep_reader.erl

Modified: couchdb/trunk/src/couchdb/couch_rep_changes_feed.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep_changes_feed.erl?rev=820851&r1=820850&r2=820851&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep_changes_feed.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep_changes_feed.erl Fri Oct  2 00:27:48 2009
@@ -298,7 +298,7 @@
     end, 0, Rows),
     by_seq_loop(Server, Source, EndSeq).
 
-decode_row(<<",\n", Rest/binary>>) ->
+decode_row(<<",", Rest/binary>>) ->
     decode_row(Rest);
 decode_row(Row) ->
     {Props} = ?JSON_DECODE(Row),

Modified: couchdb/trunk/src/couchdb/couch_rep_reader.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep_reader.erl?rev=820851&r1=820850&r2=820851&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep_reader.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep_reader.erl Fri Oct  2 00:27:48 2009
@@ -32,7 +32,7 @@
     source,
     missing_revs,
     reader_loop,
-    reader_from = nil,
+    reader_from = [],
     count = 0,
     docs = queue:new(),
     reply_to = nil,
@@ -107,7 +107,7 @@
     if NewState#state.count < ?BUFFER_SIZE ->
         {reply, ok, NewState};
     true ->
-        {noreply, NewState#state{reader_from=From}}
+        {noreply, NewState#state{reader_from=[From|State#state.reader_from]}}
     end;
 handle_add_docs(Seq, DocsToAdd, _From, #state{count=0} = State) ->
     NewState = update_sequence_lists(Seq, State),
@@ -126,10 +126,8 @@
         reader_from = ReaderFrom,
         docs = Docs
     } = State,
-    if ReaderFrom =/= nil ->
-        gen_server:reply(ReaderFrom, ok);
-    true -> ok end,
-    NewState = State#state{count=0, reader_from=nil, docs=queue:new()},
+    [gen_server:reply(F, ok) || F <- ReaderFrom],
+    NewState = State#state{count=0, reader_from=[], docs=queue:new()},
     {reply, {calculate_new_high_seq(State), queue:to_list(Docs)}, NewState}.
 
 handle_open_remote_doc(Id, Seq, Revs, From, #state{monitor_count=N} = State)



Mime
View raw message