You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2014/08/07 05:50:00 UTC

git commit: Revert "TS-2883: Initialize ret value to error condition"

Repository: trafficserver
Updated Branches:
  refs/heads/master 31056a5e0 -> 401f06ff8


Revert "TS-2883: Initialize ret value to error condition"

This reverts commit 31056a5e0cef8d139b2d5d477163e29765d004a2.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/401f06ff
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/401f06ff
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/401f06ff

Branch: refs/heads/master
Commit: 401f06ff8d61bf6d95348e120750e0d5eab2d83e
Parents: 31056a5
Author: Bryan Call <bc...@apache.org>
Authored: Wed Aug 6 20:49:53 2014 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Wed Aug 6 20:49:53 2014 -0700

----------------------------------------------------------------------
 mgmt/RecordsConfig.cc             |  2 --
 proxy/http/HttpConfig.cc          |  2 --
 proxy/http/HttpConfig.h           |  2 --
 proxy/http/HttpTransact.cc        | 13 ++++++-------
 proxy/http/HttpTransactHeaders.cc |  5 ++---
 proxy/http/HttpTransactHeaders.h  |  2 +-
 proxy/spdy/SpdyClientSession.cc   |  2 +-
 7 files changed, 10 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/401f06ff/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 3e96b6b..31890d3 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -626,8 +626,6 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.http.cache.enable_default_vary_headers", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.http.cache.post_method", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
-  ,
   {RECT_CONFIG, "proxy.config.http.cache.max_open_read_retries", RECD_INT, "-1", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.http.cache.open_read_retry_time", RECD_INT, "10", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/401f06ff/proxy/http/HttpConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index 88433a9..beac3cf 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1391,7 +1391,6 @@ HttpConfig::startup()
   HttpEstablishStaticConfigByte(c.oride.cache_ignore_auth, "proxy.config.http.cache.ignore_authentication");
   HttpEstablishStaticConfigByte(c.oride.cache_urls_that_look_dynamic, "proxy.config.http.cache.cache_urls_that_look_dynamic");
   HttpEstablishStaticConfigByte(c.cache_enable_default_vary_headers, "proxy.config.http.cache.enable_default_vary_headers");
-  HttpEstablishStaticConfigByte(c.cache_post_method, "proxy.config.http.cache.post_method");
 
   HttpEstablishStaticConfigByte(c.ignore_accept_mismatch, "proxy.config.http.cache.ignore_accept_mismatch");
   HttpEstablishStaticConfigByte(c.ignore_accept_language_mismatch, "proxy.config.http.cache.ignore_accept_language_mismatch");
@@ -1644,7 +1643,6 @@ HttpConfig::reconfigure()
   params->oride.cache_ignore_auth = INT_TO_BOOL(m_master.oride.cache_ignore_auth);
   params->oride.cache_urls_that_look_dynamic = INT_TO_BOOL(m_master.oride.cache_urls_that_look_dynamic);
   params->cache_enable_default_vary_headers = INT_TO_BOOL(m_master.cache_enable_default_vary_headers);
-  params->cache_post_method = INT_TO_BOOL(m_master.cache_post_method);
 
   params->ignore_accept_mismatch = m_master.ignore_accept_mismatch;
   params->ignore_accept_language_mismatch = m_master.ignore_accept_language_mismatch;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/401f06ff/proxy/http/HttpConfig.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index ae670f7..df819db 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -707,7 +707,6 @@ public:
   // cache control //
   ///////////////////
   MgmtByte cache_enable_default_vary_headers;
-  MgmtByte cache_post_method;
 
   ////////////////////////////////////////////
   // CONNECT ports (used to be == ssl_ports //
@@ -911,7 +910,6 @@ HttpConfigParams::HttpConfigParams()
     cache_vary_default_other(NULL),
     max_cache_open_write_retries(1),
     cache_enable_default_vary_headers(0),
-    cache_post_method(0),
     connect_ports_string(NULL),
     connect_ports(NULL),
     push_method_enabled(0),

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/401f06ff/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index a734b92..53b8e71 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -454,12 +454,11 @@ do_cookies_prevent_caching(int cookies_conf, HTTPHdr* request, HTTPHdr* response
 
 
 inline static bool
-does_method_require_cache_copy_deletion(const HttpConfigParams *http_config_param, const int method)
+does_method_require_cache_copy_deletion(int method)
 {
   return ((method != HTTP_WKSIDX_GET) &&
           (method == HTTP_WKSIDX_DELETE || method == HTTP_WKSIDX_PURGE ||
-           method == HTTP_WKSIDX_PUT ||
-           (http_config_param->cache_post_method != 1 && method == HTTP_WKSIDX_POST)));
+           method == HTTP_WKSIDX_PUT || method == HTTP_WKSIDX_POST));
 }
 
 
@@ -2266,7 +2265,7 @@ HttpTransact::issue_revalidate(State* s)
     // request to the server. is_cache_response_returnable will ensure
     // that we forward the request. We now specify what the cache
     // action should be when the response is received.
-    if (does_method_require_cache_copy_deletion(s->http_config_param, s->method)) {
+    if (does_method_require_cache_copy_deletion(s->method)) {
       s->cache_info.action = CACHE_PREPARE_TO_DELETE;
       DebugTxn("http_seq", "[HttpTransact::issue_revalidate] cache action: DELETE");
     } else {
@@ -3039,7 +3038,7 @@ HttpTransact::HandleCacheOpenReadMiss(State* s)
   }
   // We do a cache lookup for DELETE and PUT requests as well.
   // We must, however, not cache the responses to these requests.
-  if (does_method_require_cache_copy_deletion(s->http_config_param, s->method) && s->api_req_cacheable == false) {
+  if (does_method_require_cache_copy_deletion(s->method) && s->api_req_cacheable == false) {
     s->cache_info.action = CACHE_DO_NO_ACTION;
   } else if ((s->hdr_info.client_request.presence(MIME_PRESENCE_RANGE) && !s->txn_conf->cache_range_write) ||
              s->range_setup == RANGE_NOT_SATISFIABLE || s->range_setup == RANGE_NOT_HANDLED) {
@@ -5748,7 +5747,7 @@ HttpTransact::is_cache_response_returnable(State* s)
     return false;
   }
 
-  if (!HttpTransactHeaders::is_method_cacheable(s->http_config_param, s->method) && s->api_resp_cacheable == false) {
+  if (!HttpTransactHeaders::is_method_cacheable(s->method) && s->api_resp_cacheable == false) {
     SET_VIA_STRING(VIA_CACHE_RESULT, VIA_IN_CACHE_NOT_ACCEPTABLE);
     SET_VIA_STRING(VIA_DETAIL_CACHE_LOOKUP, VIA_DETAIL_MISS_METHOD);
     return false;
@@ -6023,7 +6022,7 @@ HttpTransact::is_response_cacheable(State* s, HTTPHdr* request, HTTPHdr* respons
   // Basically, the problem is the resp for POST url1 req should not
   // be served to a GET url1 request, but we just match URL not method.
   int req_method = request->method_get_wksidx();
-  if (!(HttpTransactHeaders::is_method_cacheable(s->http_config_param, req_method)) && s->api_req_cacheable == false) {
+  if (!(HttpTransactHeaders::is_method_cacheable(req_method)) && s->api_req_cacheable == false) {
     DebugTxn("http_trans", "[is_response_cacheable] " "only GET, and some HEAD and POST are cachable");
     return false;
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/401f06ff/proxy/http/HttpTransactHeaders.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransactHeaders.cc b/proxy/http/HttpTransactHeaders.cc
index 821b36c..51af5cc 100644
--- a/proxy/http/HttpTransactHeaders.cc
+++ b/proxy/http/HttpTransactHeaders.cc
@@ -31,10 +31,9 @@
 #include "I_Machine.h"
 
 bool
-HttpTransactHeaders::is_method_cacheable(const HttpConfigParams *http_config_param, const int method)
+HttpTransactHeaders::is_method_cacheable(int method)
 {
-  return (method == HTTP_WKSIDX_GET || method == HTTP_WKSIDX_HEAD ||
-          (http_config_param->cache_post_method == 1 && method == HTTP_WKSIDX_POST));
+  return (method == HTTP_WKSIDX_GET || method == HTTP_WKSIDX_HEAD);
 }
 
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/401f06ff/proxy/http/HttpTransactHeaders.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransactHeaders.h b/proxy/http/HttpTransactHeaders.h
index 6170a75..64df9bf 100644
--- a/proxy/http/HttpTransactHeaders.h
+++ b/proxy/http/HttpTransactHeaders.h
@@ -32,7 +32,7 @@ class HttpTransactHeaders
 {
 public:
   static bool is_this_http_method_supported(int method);
-  static bool is_method_cacheable(const HttpConfigParams *http_config_param, const int method);
+  static bool is_method_cacheable(int method);
   static bool is_method_cache_lookupable(int method);
   static bool is_this_a_hop_by_hop_header(const char *field_name_wks);
   static bool is_this_method_supported(int the_scheme, int the_method);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/401f06ff/proxy/spdy/SpdyClientSession.cc
----------------------------------------------------------------------
diff --git a/proxy/spdy/SpdyClientSession.cc b/proxy/spdy/SpdyClientSession.cc
index f0f8023..c2e266f 100644
--- a/proxy/spdy/SpdyClientSession.cc
+++ b/proxy/spdy/SpdyClientSession.cc
@@ -359,7 +359,7 @@ spdy_process_fetch(TSEvent event, SpdyClientSession *sm, void *edata)
 static int
 spdy_process_fetch_header(TSEvent /*event*/, SpdyClientSession *sm, TSFetchSM fetch_sm)
 {
-  int ret = -1;
+  int ret;
   SpdyRequest *req = (SpdyRequest *)TSFetchUserDataGet(fetch_sm);
 
   SpdyNV spdy_nv(fetch_sm);