summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2009-07-21 09:18:07 +0000
committerJan Lehnardt <jan@apache.org>2009-07-21 09:18:07 +0000
commit51b496b3e25c03323ce296fcb4a2a932c9b77f4b (patch)
tree1c5de2fe66114dea20fd66745b19fa70ee813fc4 /src/couchdb
parent65491b2704a2e3894e4803689313e2d90174bc47 (diff)
Close jsonp response for _changes requests. Patch by Benoit Chesneau. Closes COUCHDB-418.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@796207 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_httpd_db.erl5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl
index 5d915d30..46410ff7 100644
--- a/src/couchdb/couch_httpd_db.erl
+++ b/src/couchdb/couch_httpd_db.erl
@@ -86,12 +86,11 @@ handle_changes_req(#httpd{method='GET',path_parts=[DbName|_]}=Req, Db) ->
couch_db_update_notifier:stop(Notify),
get_rest_db_updated() % clean out any remaining update messages
end;
-
"false" ->
{ok, {LastSeq, _Prepend}} =
send_changes(Req, Resp, Db, StartSeq, <<"">>),
send_chunk(Resp, io_lib:format("\n],\n\"last_seq\":~w}\n", [LastSeq])),
- send_chunk(Resp, "")
+ end_json_response(Resp)
end;
handle_changes_req(#httpd{path_parts=[_,<<"_changes">>]}=Req, _Db) ->
@@ -121,7 +120,7 @@ keep_sending_changes(#httpd{user_ctx=UserCtx,path_parts=[DbName|_]}=Req, Resp, D
keep_sending_changes(Req, Resp, Db2, EndSeq, Prepend2, Timeout, TimeoutFun);
stop ->
send_chunk(Resp, io_lib:format("\n],\n\"last_seq\":~w}\n", [EndSeq])),
- send_chunk(Resp, "")
+ end_json_response(Resp)
end.
send_changes(Req, Resp, Db, StartSeq, Prepend0) ->