couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iil...@apache.org
Subject [06/50] couch-httpd commit: updated refs/heads/split_out_httpd_stack to e44a372
Date Tue, 01 Mar 2016 20:00:39 GMT
Merge the diff for start_response_length/4


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/commit/305e54b7
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/tree/305e54b7
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/diff/305e54b7

Branch: refs/heads/split_out_httpd_stack
Commit: 305e54b7b8d3f4f45bc3b3e11544c58f26105e73
Parents: 09d0245
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Thu Feb 25 11:27:35 2016 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Mar 1 08:35:07 2016 -0800

----------------------------------------------------------------------
 src/couch_httpd.erl          |  1 +
 src/couch_httpd_original.erl | 17 ++---------------
 2 files changed, 3 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/blob/305e54b7/src/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd.erl b/src/couch_httpd.erl
index 3928c3a..5db4989 100644
--- a/src/couch_httpd.erl
+++ b/src/couch_httpd.erl
@@ -116,6 +116,7 @@
 }).
 
 start_response_length(#httpd{mochi_req=MochiReq}=Req, Code, Headers0, Length) ->
+    log_request(Req, Code),
     couch_stats:increment_counter([couchdb, httpd_status_codes, Code]),
     Headers1 = Headers0 ++ server_header() ++
 	couch_httpd_auth:cookie_auth_header(Req, Headers0),

http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/blob/305e54b7/src/couch_httpd_original.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_original.erl b/src/couch_httpd_original.erl
index fb56c74..58937f6 100644
--- a/src/couch_httpd_original.erl
+++ b/src/couch_httpd_original.erl
@@ -22,7 +22,6 @@
 -export([etag_maybe/2]).
 
 -export([start_chunked_response/3,send_chunk/2]).
--export([start_response_length/4]).
 -export([send_response/4,send_error/2,send_error/4, send_chunked_error/2]).
 -export([accepted_encodings/1,handle_request_int/5,validate_referer/1]).
 -export([http_1_0_keep_alive/2]).
@@ -68,7 +67,8 @@
     log_request/2,
     etag_respond/3,
     etag_match/2,
-    start_reponse/3
+    start_reponse/3,
+    start_response_length/4
 ]).
 
 -define(HANDLER_NAME_IN_MODULE_POS, 6).
@@ -494,19 +494,6 @@ verify_is_server_admin(#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) ->
-    log_request(Req, Code),
-    couch_stats:increment_counter([couchdb, httpd_status_codes, Code]),
-    Headers1 = Headers ++ server_header() ++
-               couch_httpd_auth:cookie_auth_header(Req, Headers),
-    Headers2 = couch_httpd_cors:cors_headers(Req, Headers1),
-    Resp = MochiReq:start_response_length({Code, Headers2, Length}),
-    case MochiReq:get(method) of
-    'HEAD' -> throw({http_head_abort, Resp});
-    _ -> ok
-    end,
-    {ok, Resp}.
-
 
 no_resp_conn_header([]) ->
     true;


Mime
View raw message