summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/couchdb/couch_rep_changes_feed.erl2
-rw-r--r--src/couchdb/couch_rep_reader.erl10
2 files changed, 5 insertions, 7 deletions
diff --git a/src/couchdb/couch_rep_changes_feed.erl b/src/couchdb/couch_rep_changes_feed.erl
index 0c04ff61..4f56454d 100644
--- a/src/couchdb/couch_rep_changes_feed.erl
+++ b/src/couchdb/couch_rep_changes_feed.erl
@@ -298,7 +298,7 @@ by_seq_loop(Server, Source, StartSeq) ->
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),
diff --git a/src/couchdb/couch_rep_reader.erl b/src/couchdb/couch_rep_reader.erl
index a7c3fd9f..e0ebc2f0 100644
--- a/src/couchdb/couch_rep_reader.erl
+++ b/src/couchdb/couch_rep_reader.erl
@@ -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 @@ handle_add_docs(Seq, DocsToAdd, From, #state{reply_to=nil} = State) ->
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 @@ handle_next_docs(_From, State) ->
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)