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

trafficserver git commit: TS-3163: Apply socket config options to API create sockets. This closes #136

Repository: trafficserver
Updated Branches:
  refs/heads/master 2f8c94108 -> 0c81ce80c


TS-3163: Apply socket config options to API create sockets.
This closes #136


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

Branch: refs/heads/master
Commit: 0c81ce80ceadc017c00ea64f9284058284d8e168
Parents: 2f8c941
Author: Wei Sun <su...@yahoo-inc.com>
Authored: Mon Jun 15 10:26:31 2015 -0500
Committer: Alan M. Carroll <so...@yahoo-inc.com>
Committed: Mon Jun 15 13:04:08 2015 -0500

----------------------------------------------------------------------
 CHANGES         |  3 +++
 proxy/InkAPI.cc | 21 ++++++++++++++++++---
 2 files changed, 21 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0c81ce80/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 986f548..e8bd616 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 6.0.0
 
+  *) [TS-3163] Apply socket configurations to outbound connections.
+     Author: Wei Sun
+
   *) [TS-3580] Implement a cache generation ID configuration.
 
   *) [TS-3365] Enable C99 by default.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0c81ce80/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 295ae00..2614194 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -6553,9 +6553,18 @@ TSNetConnect(TSCont contp, sockaddr const *addr)
   sdk_assert(sdk_sanity_check_continuation(contp) == TS_SUCCESS);
   sdk_assert(ats_is_ip(addr));
 
+  HttpConfigParams *http_config_param = HttpConfig::acquire();
+  NetVCOptions opt;
+  if (http_config_param) {
+    opt.set_sock_param(http_config_param->oride.sock_recv_buffer_size_out, http_config_param->oride.sock_send_buffer_size_out,
+                       http_config_param->oride.sock_option_flag_out, http_config_param->oride.sock_packet_mark_out,
+                       http_config_param->oride.sock_packet_tos_out);
+  }
+  HttpConfig::release(http_config_param);
+
   FORCE_PLUGIN_SCOPED_MUTEX(contp);
 
-  return reinterpret_cast<TSAction>(netProcessor.connect_re(reinterpret_cast<INKContInternal *>(contp), addr));
+  return reinterpret_cast<TSAction>(netProcessor.connect_re(reinterpret_cast<INKContInternal *>(contp), addr, &opt));
 }
 
 TSAction
@@ -6594,8 +6603,14 @@ TSNetAccept(TSCont contp, int port, int domain, int accept_threads)
   opt.local_port = port;
   opt.frequent_accept = false;
 
-  INKContInternal *i = (INKContInternal *)contp;
-  return (TSAction)netProcessor.accept(i, opt);
+  REC_ReadConfigInteger(opt.recv_bufsize, "proxy.config.net.sock_recv_buffer_size_in");
+  REC_ReadConfigInteger(opt.send_bufsize, "proxy.config.net.sock_send_buffer_size_in");
+  REC_ReadConfigInteger(opt.sockopt_flags, "proxy.config.net.sock_option_flag_in");
+  REC_ReadConfigInteger(opt.packet_mark, "proxy.config.net.sock_packet_mark_in");
+  REC_ReadConfigInteger(opt.packet_tos, "proxy.config.net.sock_packet_tos_in");
+
+  INKContInternal *i = reinterpret_cast<INKContInternal *>(contp);
+  return reinterpret_cast<TSAction>(netProcessor.accept(i, opt));
 }
 
 /* From proxy/http/HttpProxyServerMain.c: */