You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by su...@apache.org on 2015/01/27 01:15:23 UTC

[1/2] trafficserver git commit: [TS-3326]: proxy.config.http.send_http11_requests not applied when hostdb lookup is not performed

Repository: trafficserver
Updated Branches:
  refs/heads/master ec85db857 -> b214740e7


[TS-3326]: proxy.config.http.send_http11_requests not applied when hostdb
lookup is not performed


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

Branch: refs/heads/master
Commit: 0f6f84e7b0427a3f24d65d72c82171abf49cd763
Parents: ec85db8
Author: Sudheer Vinukonda <su...@yahoo-inc.com>
Authored: Tue Jan 27 00:13:56 2015 +0000
Committer: Sudheer Vinukonda <su...@yahoo-inc.com>
Committed: Tue Jan 27 00:13:56 2015 +0000

----------------------------------------------------------------------
 proxy/http/HttpTransact.cc | 52 ++++++++++++++++++++++++++++++++++++++++-
 proxy/http/HttpTransact.h  |  1 +
 2 files changed, 52 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0f6f84e7/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 39fe64a..59056e3 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -2603,7 +2603,9 @@ HttpTransact::HandleCacheOpenReadHit(State* s)
     }
 
     if (server_up || s->stale_icp_lookup) {
-      if (!s->stale_icp_lookup && !ats_is_ip(&s->current.server->addr)) {
+      bool check_hostdb = get_ka_info_from_config(s, s->current.server);
+      DebugTxn("http_trans", "CacheOpenReadHit - check_hostdb %d", check_hostdb);
+      if (!s->stale_icp_lookup && (check_hostdb || !ats_is_ip(&s->current.server->addr))) {
 //        ink_release_assert(s->current.request_to == PARENT_PROXY ||
 //                    s->http_config_param->no_dns_forward_to_parent != 0);
 
@@ -2629,6 +2631,7 @@ HttpTransact::HandleCacheOpenReadHit(State* s)
         }
       }
 
+      DebugTxn("http_trans", "CacheOpenReadHit - version %d", s->current.server->http_version.m_version);
       build_request(s, &s->hdr_info.client_request, &s->hdr_info.server_request, s->current.server->http_version);
 
       issue_revalidate(s);
@@ -4928,6 +4931,53 @@ HttpTransact::merge_warning_header(HTTPHdr* cached_header, HTTPHdr* response_hea
   }
 }
 
+bool
+HttpTransact::get_ka_info_from_config(State *s, ConnectionAttributes *server_info)
+{
+  ////////////////////////////////////////////////////////
+  // Set the keep-alive and version flags for later use //
+  // in request construction                            //
+  // this is also used when opening a connection to     //
+  // the origin server, and search_keepalive_to().      //
+  ////////////////////////////////////////////////////////
+  bool check_hostdb = false;
+  if (server_info->http_version != HTTPVersion(0, 9)) {
+    DebugTxn("http_trans", "get_ka_info_from_config, version already set server_info->http_version %d",
+            server_info->http_version.m_version);
+    return false;
+  }
+  switch (s->txn_conf->send_http11_requests) {
+  case HttpConfigParams::SEND_HTTP11_NEVER:
+    server_info->http_version = HTTPVersion(1, 0);
+    break;
+  case HttpConfigParams::SEND_HTTP11_ALWAYS:
+    server_info->http_version = HTTPVersion(1, 1);
+    break;
+  case HttpConfigParams::SEND_HTTP11_UPGRADE_HOSTDB:
+    server_info->http_version = HTTPVersion(1, 0);
+    check_hostdb = true;
+    break;
+  default:
+    ink_assert(0);
+    // FALL THROUGH
+  case HttpConfigParams::SEND_HTTP11_IF_REQUEST_11_AND_HOSTDB:
+    server_info->http_version = HTTPVersion(1, 0);
+    check_hostdb = true;
+    break;
+  }
+  DebugTxn("http_trans", "get_ka_info_from_config, server_info->http_version %d, check_hostdb %d",
+            server_info->http_version.m_version, check_hostdb);
+  /////////////////////////////
+  // origin server keep_alive //
+  /////////////////////////////
+  if (s->txn_conf->keep_alive_enabled_out) {
+    server_info->keep_alive = HTTP_KEEPALIVE;
+  } else {
+    server_info->keep_alive = HTTP_NO_KEEPALIVE;
+  }
+  return check_hostdb;
+}
+
 void
 HttpTransact::get_ka_info_from_host_db(State *s, ConnectionAttributes *server_info,
                                        ConnectionAttributes * /* client_info ATS_UNUSED */, HostDBInfo *host_db_info)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0f6f84e7/proxy/http/HttpTransact.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index f30f19c..4de29e8 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -1296,6 +1296,7 @@ public:
 
   // Utility Methods
   static void issue_revalidate(State* s);
+  static bool get_ka_info_from_config(State* s, ConnectionAttributes* server_info);
   static void get_ka_info_from_host_db(State* s, ConnectionAttributes* server_info, ConnectionAttributes* client_info,
                                        HostDBInfo* host_db_info);
   static bool service_transaction_in_proxy_only_mode(State* s);


[2/2] trafficserver git commit: update CHANGES

Posted by su...@apache.org.
update CHANGES


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

Branch: refs/heads/master
Commit: b214740e737c88137849fac0b7cf31eb36de036c
Parents: 0f6f84e
Author: Sudheer Vinukonda <su...@yahoo-inc.com>
Authored: Tue Jan 27 00:15:13 2015 +0000
Committer: Sudheer Vinukonda <su...@yahoo-inc.com>
Committed: Tue Jan 27 00:15:13 2015 +0000

----------------------------------------------------------------------
 CHANGES | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b214740e/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 6cd92f6..aa6f4fd 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.3.0
+  *) [TS-3326] apply proxy.config.http.send_http11_requests when hostdb is skipped
+
   *) [TS-1547] in HTTPHdr::copy hdr ptr is error
 
   *) [TS-3323] Cache scan will stop early if any empty volumes