From ec9ad52b8444317ededce3a5f2dc4ae63c89d763 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Mon, 21 Sep 2009 20:18:41 +0000 Subject: bugfix for _changes when DB is deleted mid-response git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@817398 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd_db.erl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/couchdb') diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl index cdc74610..32fc1b11 100644 --- a/src/couchdb/couch_httpd_db.erl +++ b/src/couchdb/couch_httpd_db.erl @@ -155,9 +155,13 @@ keep_sending_changes(#httpd{user_ctx=UserCtx,path_parts=[DbName|_]}=Req, Resp, 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 -- cgit v1.2.3