couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iil...@apache.org
Subject [11/50] couch-httpd commit: updated refs/heads/split_out_httpd_stack to e44a372
Date Tue, 01 Mar 2016 20:00:44 GMT
Bring start_response/3 from original


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/09d02456
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/tree/09d02456
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/diff/09d02456

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

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/blob/09d02456/src/couch_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd.erl b/src/couch_httpd.erl
index bf44e96..3928c3a 100644
--- a/src/couch_httpd.erl
+++ b/src/couch_httpd.erl
@@ -16,6 +16,7 @@
 
 -export([
     start_response_length/4,
+    start_response/3,
     start_chunked_response/3,
     start_json_response/2,
     start_json_response/3,
@@ -126,6 +127,19 @@ start_response_length(#httpd{mochi_req=MochiReq}=Req, Code, Headers0,
Length) ->
     end,
     {ok, Resp}.
 
+start_response(#httpd{mochi_req=MochiReq}=Req, Code, Headers) ->
+    log_request(Req, Code),
+    couch_stats:increment_counter([couchdb, httpd_status_codes, Code]),
+    CookieHeader = couch_httpd_auth:cookie_auth_header(Req, Headers),
+    Headers1 = Headers ++ server_header() ++ CookieHeader,
+    Headers2 = couch_httpd_cors:cors_headers(Req, Headers1),
+    Resp = MochiReq:start_response({Code, Headers2}),
+    case MochiReq:get(method) of
+        'HEAD' -> throw({http_head_abort, Resp});
+        _ -> ok
+    end,
+    {ok, Resp}.
+
 start_chunked_response(#httpd{mochi_req=MochiReq}=Req, Code, Headers0) ->
     couch_stats:increment_counter([couchdb, httpd_status_codes, Code]),
     Headers1 = Headers0 ++ server_header() ++

http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/blob/09d02456/src/couch_httpd_original.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_original.erl b/src/couch_httpd_original.erl
index 95a7c6f..fb56c74 100644
--- a/src/couch_httpd_original.erl
+++ b/src/couch_httpd_original.erl
@@ -22,7 +22,7 @@
 -export([etag_maybe/2]).
 
 -export([start_chunked_response/3,send_chunk/2]).
--export([start_response_length/4, start_response/3]).
+-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]).
@@ -67,7 +67,8 @@
     body/1,
     log_request/2,
     etag_respond/3,
-    etag_match/2
+    etag_match/2,
+    start_reponse/3
 ]).
 
 -define(HANDLER_NAME_IN_MODULE_POS, 6).
@@ -506,19 +507,6 @@ start_response_length(#httpd{mochi_req=MochiReq}=Req, Code, Headers,
Length) ->
     end,
     {ok, Resp}.
 
-start_response(#httpd{mochi_req=MochiReq}=Req, Code, Headers) ->
-    log_request(Req, Code),
-    couch_stats:increment_counter([couchdb, httpd_status_codes, Code]),
-    CookieHeader = couch_httpd_auth:cookie_auth_header(Req, Headers),
-    Headers1 = Headers ++ server_header() ++ CookieHeader,
-    Headers2 = couch_httpd_cors:cors_headers(Req, Headers1),
-    Resp = MochiReq:start_response({Code, Headers2}),
-    case MochiReq:get(method) of
-        'HEAD' -> throw({http_head_abort, Resp});
-        _ -> ok
-    end,
-    {ok, Resp}.
-
 
 no_resp_conn_header([]) ->
     true;


Mime
View raw message