summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_httpd.erl
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-08-14 06:10:16 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-08-14 06:10:16 +0000
commit83ec3acc48ad9918ca54168a3a41a60f6b0a615e (patch)
tree4bda1205146759e4a7bfd7fa6ac03bf44f7ad7fd /src/couchdb/couch_httpd.erl
parent9d5e79af0d87ff2f5e361396976d7a0ee7a3af13 (diff)
apply Benoit's patch fixing attachment content-length handling for GET from COUCHDB-461
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@804087 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd.erl')
-rw-r--r--src/couchdb/couch_httpd.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index fde02317..66fc1062 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -20,6 +20,7 @@
-export([parse_form/1,json_body/1,json_body_obj/1,body/1,doc_etag/1, make_etag/1, etag_respond/3]).
-export([primary_header_value/2,partition/1,serve_file/3, server_header/0]).
-export([start_chunked_response/3,send_chunk/2]).
+-export([start_response_length/4, send/2]).
-export([start_json_response/2, start_json_response/3, end_json_response/1]).
-export([send_response/4,send_method_not_allowed/2,send_error/4, send_redirect/2,send_chunked_error/2]).
-export([send_json/2,send_json/3,send_json/4]).
@@ -334,7 +335,13 @@ verify_is_server_admin(#httpd{user_ctx=#user_ctx{roles=Roles}}) ->
false -> throw({unauthorized, <<"You are not a server admin.">>})
end.
+start_response_length(#httpd{mochi_req=MochiReq}=Req, Code, Headers, Length) ->
+ couch_stats_collector:increment({httpd_status_codes, Code}),
+ {ok, MochiReq:start_response_length({Code, Headers ++ server_header() ++ couch_httpd_auth:cookie_auth_header(Req, Headers), Length})}.
+send(Resp, Data) ->
+ Resp:send(Data),
+ {ok, Resp}.
start_chunked_response(#httpd{mochi_req=MochiReq}=Req, Code, Headers) ->
couch_stats_collector:increment({httpd_status_codes, Code}),