couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r954035 - in /couchdb/branches/0.11.x/src/couchdb: couch_rep_att.erl couch_rep_reader.erl
Date Sat, 12 Jun 2010 16:53:32 GMT
Author: kocolosk
Date: Sat Jun 12 16:53:31 2010
New Revision: 954035

URL: http://svn.apache.org/viewvc?rev=954035&view=rev
Log:
backport fix #1 from COUCHDB-793

Modified:
    couchdb/branches/0.11.x/src/couchdb/couch_rep_att.erl
    couchdb/branches/0.11.x/src/couchdb/couch_rep_reader.erl

Modified: couchdb/branches/0.11.x/src/couchdb/couch_rep_att.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/src/couchdb/couch_rep_att.erl?rev=954035&r1=954034&r2=954035&view=diff
==============================================================================
--- couchdb/branches/0.11.x/src/couchdb/couch_rep_att.erl (original)
+++ couchdb/branches/0.11.x/src/couchdb/couch_rep_att.erl Sat Jun 12 16:53:31 2010
@@ -54,7 +54,7 @@ attachment_receiver(Ref, Request) ->
         receive_data(Ref, ReqId, ContentEncoding)
     end
     catch
-    throw:{attachment_request_failed, timeout} ->
+    throw:{attachment_request_failed, _} ->
         case {Request#http_db.retries, Request#http_db.pause} of
         {0, _} ->
              ?LOG_INFO("request for ~p failed", [Request#http_db.resource]),

Modified: couchdb/branches/0.11.x/src/couchdb/couch_rep_reader.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/src/couchdb/couch_rep_reader.erl?rev=954035&r1=954034&r2=954035&view=diff
==============================================================================
--- couchdb/branches/0.11.x/src/couchdb/couch_rep_reader.erl (original)
+++ couchdb/branches/0.11.x/src/couchdb/couch_rep_reader.erl Sat Jun 12 16:53:31 2010
@@ -108,6 +108,8 @@ code_change(_OldVsn, State, _Extra) ->
 
 %internal funs
 
+handle_add_docs(_Seq, [], _From, State) ->
+    {reply, ok, State};
 handle_add_docs(Seq, DocsToAdd, From, #state{reply_to=nil} = State) ->
     State1 = update_sequence_lists(Seq, State),
     NewState = State1#state{
@@ -151,9 +153,13 @@ handle_open_remote_doc(Id, Seq, Revs, _,
     {_, _Ref} = spawn_document_request(Source, Id, Seq, Revs),
     {reply, ok, State#state{monitor_count = Count+1}}.
 
-handle_monitor_down(normal, #state{pending_doc_request=nil,
+handle_monitor_down(normal, #state{pending_doc_request=nil, reply_to=nil,
         monitor_count=1, complete=waiting_on_monitors} = State) ->
     {noreply, State#state{complete=true, monitor_count=0}};
+handle_monitor_down(normal, #state{pending_doc_request=nil, reply_to=From,
+        monitor_count=1, complete=waiting_on_monitors} = State) ->
+    gen_server:reply(From, {complete, calculate_new_high_seq(State)}),
+    {stop, normal, State#state{complete=true, monitor_count=0}};
 handle_monitor_down(normal, #state{pending_doc_request=nil} = State) ->
     #state{monitor_count = Count} = State,
     {noreply, State#state{monitor_count = Count-1}};



Mime
View raw message