From cbd893d573e2b37baa50528f2d4a639f885ebefa Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Tue, 27 Oct 2009 21:40:25 +0000 Subject: Make it harder to accidently terminate chunked resposnes by requiring callers to explicity call last_chunk(Req) and ignoring send_chunk calls with no data. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@830353 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_httpd_show.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/couchdb/couch_httpd_show.erl') diff --git a/src/couchdb/couch_httpd_show.erl b/src/couchdb/couch_httpd_show.erl index 896c833e..fe8e2002 100644 --- a/src/couchdb/couch_httpd_show.erl +++ b/src/couchdb/couch_httpd_show.erl @@ -19,7 +19,7 @@ -import(couch_httpd, [send_json/2,send_json/3,send_json/4,send_method_not_allowed/2, - start_json_response/2,send_chunk/2,send_chunked_error/2, + start_json_response/2,send_chunk/2,last_chunk/1,send_chunked_error/2, start_chunked_response/3, send_error/4]). handle_doc_show_req(#httpd{ @@ -365,7 +365,7 @@ finish_list(Req, QueryServer, Etag, FoldResult, StartFun, TotalRows) -> [<<"end">>, Chunks] = couch_query_servers:render_list_tail(QueryServer), send_non_empty_chunk(Resp, ?b2l(?l2b(Chunks))) end, - send_chunk(Resp, []). + last_chunk(Resp). render_head_for_empty_list(StartListRespFun, Req, Etag, null) -> -- cgit v1.2.3