summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd_misc_handlers.erl
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2010-02-24 04:15:58 +0000
committerJan Lehnardt <jan@apache.org>2010-02-24 04:15:58 +0000
commit0dd8f16e42f4f1d7206cc6d4c7e49b6cf420f725 (patch)
treeae6f796f543bc66bc2481550b6d078f6d99b7a95 /src/couchdb/couch_httpd_misc_handlers.erl
parent21bf95639695e0a3a8379ff2a03a0061246870b0 (diff)
Allow replication to be cancelled. Closes COUCHDB-664. Patch by Robert Newson.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@915664 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_misc_handlers.erl')
-rw-r--r--src/couchdb/couch_httpd_misc_handlers.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl
index a8543306..d58dfacd 100644
--- a/src/couchdb/couch_httpd_misc_handlers.erl
+++ b/src/couchdb/couch_httpd_misc_handlers.erl
@@ -90,10 +90,14 @@ handle_replicate_req(#httpd{method='POST'}=Req) ->
try couch_rep:replicate(PostBody, Req#httpd.user_ctx) of
{ok, {continuous, RepId}} ->
send_json(Req, 202, {[{ok, true}, {<<"_local_id">>, RepId}]});
+ {ok, {cancelled, RepId}} ->
+ send_json(Req, 200, {[{ok, true}, {<<"_local_id">>, RepId}]});
{ok, {JsonResults}} ->
send_json(Req, {[{ok, true} | JsonResults]});
{error, {Type, Details}} ->
send_json(Req, 500, {[{error, Type}, {reason, Details}]});
+ {error, not_found} ->
+ send_json(Req, 404, {[{error, not_found}]});
{error, Reason} ->
send_json(Req, 500, {[{error, Reason}]})
catch