couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iil...@apache.org
Subject [13/50] couch-httpd commit: updated refs/heads/split_out_httpd_stack to e44a372
Date Tue, 01 Mar 2016 20:00:46 GMT
Remove equivalent copy of etag_respond/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/8e243539
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/tree/8e243539
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/diff/8e243539

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

----------------------------------------------------------------------
 src/couch_httpd_original.erl | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-httpd/blob/8e243539/src/couch_httpd_original.erl
----------------------------------------------------------------------
diff --git a/src/couch_httpd_original.erl b/src/couch_httpd_original.erl
index 0152de5..b84df74 100644
--- a/src/couch_httpd_original.erl
+++ b/src/couch_httpd_original.erl
@@ -19,7 +19,7 @@
 -export([verify_is_server_admin/1,error_info/1]).
 -export([make_fun_spec_strs/1]).
 
--export([etag_match/2, etag_respond/3, etag_maybe/2]).
+-export([etag_match/2, etag_maybe/2]).
 
 -export([start_chunked_response/3,send_chunk/2]).
 -export([start_response_length/4, start_response/3]).
@@ -65,7 +65,8 @@
     send_redirect/2,
     absolute_uri/2,
     body/1,
-    log_request/2
+    log_request/2,
+    etag_respond/3
 ]).
 
 -define(HANDLER_NAME_IN_MODULE_POS, 6).
@@ -483,16 +484,6 @@ etag_match(Req, CurrentEtag) ->
         header_value(Req, "If-None-Match", ""), ", "),
     lists:member(CurrentEtag, EtagsToMatch).
 
-etag_respond(Req, CurrentEtag, RespFun) ->
-    case etag_match(Req, CurrentEtag) of
-    true ->
-        % the client has this in their cache.
-        send_response(Req, 304, [{"ETag", CurrentEtag}], <<>>);
-    false ->
-        % Run the function.
-        RespFun()
-    end.
-
 etag_maybe(Req, RespFun) ->
     try
         RespFun()


Mime
View raw message