You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2009/09/21 22:18:41 UTC

svn commit: r817398 - /couchdb/trunk/src/couchdb/couch_httpd_db.erl

Author: kocolosk
Date: Mon Sep 21 20:18:41 2009
New Revision: 817398

URL: http://svn.apache.org/viewvc?rev=817398&view=rev
Log:
bugfix for _changes when DB is deleted mid-response

Modified:
    couchdb/trunk/src/couchdb/couch_httpd_db.erl

Modified: couchdb/trunk/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_db.erl?rev=817398&r1=817397&r2=817398&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_db.erl Mon Sep 21 20:18:41 2009
@@ -155,9 +155,13 @@
     true ->
         case wait_db_updated(Timeout, TimeoutFun) of
         updated ->
-            {ok, Db2} = couch_db:open(DbName, [{user_ctx, UserCtx}]),
-            keep_sending_changes(Req, Resp, Db2, EndSeq, Prepend2, Timeout,
-                TimeoutFun, ResponseType, NewLimit, Filter, End);
+            case couch_db:open(DbName, [{user_ctx, UserCtx}]) of
+            {ok, Db2} ->
+                keep_sending_changes(Req, Resp, Db2, EndSeq, Prepend2, Timeout,
+                    TimeoutFun, ResponseType, NewLimit, Filter, End);
+            _Else ->
+                end_sending_changes(Resp, EndSeq, ResponseType)
+            end;
         stop ->
             end_sending_changes(Resp, EndSeq, ResponseType)
         end