You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2017/02/10 15:45:54 UTC
[trafficserver] branch 6.2.x updated (a858aad -> 45d6cb7)
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a change to branch 6.2.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git.
from a858aad SSL_CTX_remove_session() and external cache
new 4c4d646 issue #1399 add back partial code of tcp_congestion_control erased by TS-3612
new 45d6cb7 Fix a build issue that use of undeclared variables
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.
Summary of changes:
iocore/net/I_NetVConnection.h | 2 +-
iocore/net/P_UnixNetVConnection.h | 38 ++++++++++++++++++++++++++++----------
proxy/PluginVC.cc | 2 +-
proxy/PluginVC.h | 2 +-
proxy/http/Http1ClientSession.cc | 2 ++
proxy/http/HttpServerSession.cc | 10 ++--------
proxy/http2/Http2ClientSession.cc | 2 ++
7 files changed, 37 insertions(+), 21 deletions(-)
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].
[trafficserver] 02/02: Fix a build issue that use of undeclared
variables
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch 6.2.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit 45d6cb730f33aaee7acfc8da7a3681c74b9a72b8
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Thu Feb 9 10:13:50 2017 +0900
Fix a build issue that use of undeclared variables
PR-1426 causes build error on some platforms which doesn't support congestion control.
(cherry picked from commit 734aa31e0e6b4b200f960eb2be0282ce4826b969)
---
iocore/net/P_UnixNetVConnection.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/iocore/net/P_UnixNetVConnection.h b/iocore/net/P_UnixNetVConnection.h
index a48bd2f..be6a86d 100644
--- a/iocore/net/P_UnixNetVConnection.h
+++ b/iocore/net/P_UnixNetVConnection.h
@@ -466,10 +466,11 @@ UnixNetVConnection::set_tcp_congestion_control(int side)
RecString congestion_control;
int ret;
- if (side == CLIENT_SIDE)
+ if (side == CLIENT_SIDE) {
ret = REC_ReadConfigStringAlloc(congestion_control, "proxy.config.net.tcp_congestion_control_in");
- else
+ } else {
ret = REC_ReadConfigStringAlloc(congestion_control, "proxy.config.net.tcp_congestion_control_out");
+ }
if (ret == REC_ERR_OKAY) {
int len = strlen(congestion_control);
@@ -488,7 +489,7 @@ UnixNetVConnection::set_tcp_congestion_control(int side)
}
return -1;
#else
- Debug("socket", "Setting TCP congestion control %.*s is not supported on this platform.", len, name);
+ Debug("socket", "Setting TCP congestion control is not supported on this platform.");
return -1;
#endif
}
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.
[trafficserver] 01/02: issue #1399 add back partial code of
tcp_congestion_control erased by TS-3612
Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch 6.2.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit 4c4d646cb6e67539ff84003d14007219ac2f00ca
Author: Shen Zhang <se...@linkedin.com>
AuthorDate: Wed Feb 8 14:39:01 2017 -0800
issue #1399 add back partial code of tcp_congestion_control erased by TS-3612
(cherry picked from commit f71b75ef6f32abd168ac646a50be238e4375cadf)
---
iocore/net/I_NetVConnection.h | 2 +-
iocore/net/P_UnixNetVConnection.h | 37 +++++++++++++++++++++++++++----------
proxy/PluginVC.cc | 2 +-
proxy/PluginVC.h | 2 +-
proxy/http/Http1ClientSession.cc | 2 ++
proxy/http/HttpServerSession.cc | 10 ++--------
proxy/http2/Http2ClientSession.cc | 2 ++
7 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/iocore/net/I_NetVConnection.h b/iocore/net/I_NetVConnection.h
index e7d147d..7d57776 100644
--- a/iocore/net/I_NetVConnection.h
+++ b/iocore/net/I_NetVConnection.h
@@ -531,7 +531,7 @@ public:
virtual int set_tcp_init_cwnd(int init_cwnd) = 0;
/** Set the TCP congestion control algorithm */
- virtual int set_tcp_congestion_control(const char *name, int len) = 0;
+ virtual int set_tcp_congestion_control(int side) = 0;
/** Set local sock addr struct. */
virtual void set_local_addr() = 0;
diff --git a/iocore/net/P_UnixNetVConnection.h b/iocore/net/P_UnixNetVConnection.h
index 21a2580..a48bd2f 100644
--- a/iocore/net/P_UnixNetVConnection.h
+++ b/iocore/net/P_UnixNetVConnection.h
@@ -97,6 +97,8 @@ struct OOB_callback : public Continuation {
}
};
+enum tcp_congestion_control_t { CLIENT_SIDE, SERVER_SIDE };
+
class UnixNetVConnection : public NetVConnection
{
public:
@@ -292,7 +294,7 @@ public:
virtual void set_local_addr();
virtual void set_remote_addr();
virtual int set_tcp_init_cwnd(int init_cwnd);
- virtual int set_tcp_congestion_control(const char *name, int len);
+ virtual int set_tcp_congestion_control(int side);
virtual void apply_options();
friend void write_to_net_io(NetHandler *, UnixNetVConnection *, EThread *);
@@ -458,18 +460,33 @@ UnixNetVConnection::set_tcp_init_cwnd(int init_cwnd)
}
TS_INLINE int
-UnixNetVConnection::set_tcp_congestion_control(const char *name, int len)
+UnixNetVConnection::set_tcp_congestion_control(int side)
{
#ifdef TCP_CONGESTION
- int rv = 0;
- rv = setsockopt(con.fd, IPPROTO_TCP, TCP_CONGESTION, reinterpret_cast<void *>(const_cast<char *>(name)), len);
- if (rv < 0) {
- Error("Unable to set TCP congestion control on socket %d to \"%.*s\", errno=%d (%s)", con.fd, len, name, errno,
- strerror(errno));
- } else {
- Debug("socket", "Setting TCP congestion control on socket [%d] to \"%.*s\" -> %d", con.fd, len, name, rv);
+ RecString congestion_control;
+ int ret;
+
+ if (side == CLIENT_SIDE)
+ ret = REC_ReadConfigStringAlloc(congestion_control, "proxy.config.net.tcp_congestion_control_in");
+ else
+ ret = REC_ReadConfigStringAlloc(congestion_control, "proxy.config.net.tcp_congestion_control_out");
+
+ if (ret == REC_ERR_OKAY) {
+ int len = strlen(congestion_control);
+ if (len > 0) {
+ int rv = 0;
+ rv = setsockopt(con.fd, IPPROTO_TCP, TCP_CONGESTION, reinterpret_cast<void *>(congestion_control), len);
+ if (rv < 0) {
+ Error("Unable to set TCP congestion control on socket %d to \"%.*s\", errno=%d (%s)", con.fd, len, congestion_control,
+ errno, strerror(errno));
+ } else {
+ Debug("socket", "Setting TCP congestion control on socket [%d] to \"%.*s\" -> %d", con.fd, len, congestion_control, rv);
+ }
+ }
+ ats_free(congestion_control);
+ return 0;
}
- return rv;
+ return -1;
#else
Debug("socket", "Setting TCP congestion control %.*s is not supported on this platform.", len, name);
return -1;
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index edcbb74..247accf 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -923,7 +923,7 @@ PluginVC::set_tcp_init_cwnd(int /* init_cwnd ATS_UNUSED */)
}
int
-PluginVC::set_tcp_congestion_control(const char *ATS_UNUSED, int ATS_UNUSED)
+PluginVC::set_tcp_congestion_control(int ATS_UNUSED)
{
return -1;
}
diff --git a/proxy/PluginVC.h b/proxy/PluginVC.h
index daa9c03..c9fcfee 100644
--- a/proxy/PluginVC.h
+++ b/proxy/PluginVC.h
@@ -104,7 +104,7 @@ public:
virtual void set_local_addr();
virtual void set_remote_addr();
virtual int set_tcp_init_cwnd(int init_cwnd);
- virtual int set_tcp_congestion_control(const char *name, int len);
+ virtual int set_tcp_congestion_control(int);
virtual void apply_options();
diff --git a/proxy/http/Http1ClientSession.cc b/proxy/http/Http1ClientSession.cc
index 78a0614..dd8d9c4 100644
--- a/proxy/http/Http1ClientSession.cc
+++ b/proxy/http/Http1ClientSession.cc
@@ -179,6 +179,8 @@ Http1ClientSession::new_connection(NetVConnection *new_vc, MIOBuffer *iobuf, IOB
DebugHttpSsn("[%" PRId64 "] session born, netvc %p", con_id, new_vc);
+ client_vc->set_tcp_congestion_control(CLIENT_SIDE);
+
read_buffer = iobuf ? iobuf : new_MIOBuffer(HTTP_HEADER_BUFFER_SIZE_INDEX);
sm_reader = reader ? reader : read_buffer->alloc_reader();
trans.set_reader(sm_reader);
diff --git a/proxy/http/HttpServerSession.cc b/proxy/http/HttpServerSession.cc
index 9336de3..6de3a0e 100644
--- a/proxy/http/HttpServerSession.cc
+++ b/proxy/http/HttpServerSession.cc
@@ -90,14 +90,8 @@ HttpServerSession::new_connection(NetVConnection *new_vc)
buf_reader = read_buffer->alloc_reader();
Debug("http_ss", "[%" PRId64 "] session born, netvc %p", con_id, new_vc);
state = HSS_INIT;
- RecString congestion_control_out;
- if (REC_ReadConfigStringAlloc(congestion_control_out, "proxy.config.net.tcp_congestion_control_out") == REC_ERR_OKAY) {
- int len = strlen(congestion_control_out);
- if (len > 0) {
- new_vc->set_tcp_congestion_control(congestion_control_out, len);
- }
- ats_free(congestion_control_out);
- }
+
+ new_vc->set_tcp_congestion_control(SERVER_SIDE);
}
VIO *
diff --git a/proxy/http2/Http2ClientSession.cc b/proxy/http2/Http2ClientSession.cc
index 7de8c9d..b75a458 100644
--- a/proxy/http2/Http2ClientSession.cc
+++ b/proxy/http2/Http2ClientSession.cc
@@ -185,6 +185,8 @@ Http2ClientSession::new_connection(NetVConnection *new_vc, MIOBuffer *iobuf, IOB
DebugHttp2Ssn("session born, netvc %p", this->client_vc);
+ this->client_vc->set_tcp_congestion_control(CLIENT_SIDE);
+
this->read_buffer = iobuf ? iobuf : new_MIOBuffer(HTTP2_HEADER_BUFFER_SIZE_INDEX);
this->read_buffer->water_mark = connection_state.server_settings.get(HTTP2_SETTINGS_MAX_FRAME_SIZE);
this->sm_reader = reader ? reader : this->read_buffer->alloc_reader();
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.