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/11/20 15:49:04 UTC

trafficserver git commit: Fix issue with TS-3885. Changes to TSNetVConn test to prevent it from hanging when the defer_accept is set ( via config or kernel option). This close #313.

Repository: trafficserver
Updated Branches:
  refs/heads/master 4188d7f26 -> 9dc6dabed


Fix issue with TS-3885. Changes to TSNetVConn test to prevent it from hanging when the defer_accept is set ( via config or kernel option).
This close #313.


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

Branch: refs/heads/master
Commit: 9dc6dabed9afcde8199db1c2debc62d72274ea4e
Parents: 4188d7f
Author: Jason Kenny <jk...@yahoo-inc.com>
Authored: Tue Oct 27 09:30:35 2015 -0500
Committer: Alan M. Carroll <am...@apache.org>
Committed: Fri Nov 20 08:48:51 2015 -0600

----------------------------------------------------------------------
 proxy/InkAPITest.cc | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9dc6dabe/proxy/InkAPITest.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 92fa95a..566ca88 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -298,6 +298,8 @@ server_handler(TSCont contp, TSEvent event, void *data)
     SDK_RPRINT(params->test, params->api, "ServerEvent EOS", TC_PASS, "ok");
     *params->pstatus = REGRESSION_TEST_PASSED;
     delete params;
+  } else if (event == TS_EVENT_VCONN_READ_READY) {
+    SDK_RPRINT(params->test, params->api, "ServerEvent READ_READY", TC_PASS, "ok");
   } else {
     SDK_RPRINT(params->test, params->api, "ServerEvent", TC_FAIL, "received unexpected event %d", event);
     *params->pstatus = REGRESSION_TEST_FAILED;
@@ -321,10 +323,16 @@ client_handler(TSCont contp, TSEvent event, void *data)
     // Fix me: how to deal with server side cont?
     TSContDestroy(contp);
     return 1;
-  } else {
+  } else if (TS_EVENT_NET_CONNECT == event) {
     sockaddr const *addr = TSNetVConnRemoteAddrGet(static_cast<TSVConn>(data));
     uint16_t input_server_port = ats_ip_port_host_order(addr);
 
+    // If DEFER_ACCEPT is enabled in the OS then the user space accept() doesn't
+    // happen until data arrives on the socket. Because we're just testing the accept()
+    // we write a small amount of ignored data to make sure this gets triggered.
+    UnixNetVConnection *vc = static_cast<UnixNetVConnection *>(data);
+    ::write(vc->con.fd, "Bob's your uncle", 16);
+
     sleep(1); // XXX this sleep ensures the server end gets the accept event.
 
     if (ats_is_ip_loopback(addr)) {