trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shinr...@apache.org
Subject [trafficserver] branch master updated: Remove unused OOB network logic (#8094)
Date Tue, 20 Jul 2021 17:26:01 GMT
This is an automated email from the ASF dual-hosted git repository.

shinrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new a618b4b  Remove unused OOB network logic (#8094)
a618b4b is described below

commit a618b4b2f2954f58f6904b16ef56d92754a8324e
Author: Susan Hinrichs <shinrich@verizonmedia.com>
AuthorDate: Tue Jul 20 12:25:50 2021 -0500

    Remove unused OOB network logic (#8094)
---
 iocore/eventsystem/I_VConnection.h |  2 --
 iocore/net/I_NetVConnection.h      | 24 ----------------
 iocore/net/NetVConnection.cc       | 11 -------
 iocore/net/P_UnixNetVConnection.h  | 21 --------------
 iocore/net/SSLNetVConnection.cc    |  2 --
 iocore/net/UnixNetVConnection.cc   | 59 --------------------------------------
 6 files changed, 119 deletions(-)

diff --git a/iocore/eventsystem/I_VConnection.h b/iocore/eventsystem/I_VConnection.h
index e739fc6..bfbeb0c 100644
--- a/iocore/eventsystem/I_VConnection.h
+++ b/iocore/eventsystem/I_VConnection.h
@@ -88,8 +88,6 @@
 */
 #define VC_EVENT_ACTIVE_TIMEOUT (VC_EVENT_EVENTS_START + 6)
 
-#define VC_EVENT_OOB_COMPLETE (VC_EVENT_EVENTS_START + 7)
-
 //
 // Event names
 //
diff --git a/iocore/net/I_NetVConnection.h b/iocore/net/I_NetVConnection.h
index ea29017..a23e08c 100644
--- a/iocore/net/I_NetVConnection.h
+++ b/iocore/net/I_NetVConnection.h
@@ -473,21 +473,6 @@ public:
   void do_io_shutdown(ShutdownHowTo_t howto) override = 0;
 
   /**
-    Sends out of band messages over the connection. This function
-    is used to send out of band messages (is this still useful?).
-    cont is called back with VC_EVENT_OOB_COMPLETE - on successful
-    send or VC_EVENT_EOS - if the other side has shutdown the
-    connection. These callbacks could be re-entrant. Only one
-    send_OOB can be in progress at any time for a VC.
-
-    @param cont to be called back with events.
-    @param buf message buffer.
-    @param len length of the message.
-
-  */
-  virtual Action *send_OOB(Continuation *cont, char *buf, int len);
-
-  /**
     Return the server name that is appropriate for the network VC type
   */
   virtual const char *
@@ -496,15 +481,6 @@ public:
     return nullptr;
   }
 
-  /**
-    Cancels a scheduled send_OOB. Part of the message could have
-    been sent already. Not callbacks to the cont are made after
-    this call. The Action returned by send_OOB should not be accessed
-    after cancel_OOB.
-
-  */
-  virtual void cancel_OOB();
-
   ////////////////////////////////////////////////////////////
   // Set the timeouts associated with this connection.      //
   // active_timeout is for the total elapsed time of        //
diff --git a/iocore/net/NetVConnection.cc b/iocore/net/NetVConnection.cc
index 512a1ce..df4c51f 100644
--- a/iocore/net/NetVConnection.cc
+++ b/iocore/net/NetVConnection.cc
@@ -36,17 +36,6 @@
 ////
 // NetVConnection
 //
-Action *
-NetVConnection::send_OOB(Continuation *, char *, int)
-{
-  return ACTION_RESULT_DONE;
-}
-
-void
-NetVConnection::cancel_OOB()
-{
-  return;
-}
 
 /**
    PROXY Protocol check with IOBufferReader
diff --git a/iocore/net/P_UnixNetVConnection.h b/iocore/net/P_UnixNetVConnection.h
index 399e1d9..ca79b76 100644
--- a/iocore/net/P_UnixNetVConnection.h
+++ b/iocore/net/P_UnixNetVConnection.h
@@ -86,23 +86,6 @@ NetVCOptions::set_sock_param(int _recv_bufsize, int _send_bufsize, unsigned
long
   packet_tos          = _packet_tos;
 }
 
-struct OOB_callback : public Continuation {
-  char *data;
-  int length;
-  Event *trigger;
-  UnixNetVConnection *server_vc;
-  Continuation *server_cont;
-  int retry_OOB_send(int, Event *);
-
-  OOB_callback(Ptr<ProxyMutex> &m, NetVConnection *vc, Continuation *cont, char
*buf, int len)
-    : Continuation(m), data(buf), length(len), trigger(nullptr)
-  {
-    server_vc   = (UnixNetVConnection *)vc;
-    server_cont = cont;
-    SET_HANDLER(&OOB_callback::retry_OOB_send);
-  }
-};
-
 enum tcp_congestion_control_t { CLIENT_SIDE, SERVER_SIDE };
 
 class UnixNetVConnection : public NetVConnection, public NetEvent
@@ -116,9 +99,6 @@ public:
 
   bool get_data(int id, void *data) override;
 
-  Action *send_OOB(Continuation *cont, char *buf, int len) override;
-  void cancel_OOB() override;
-
   const char *
   get_server_name() const override
   {
@@ -265,7 +245,6 @@ public:
 
   Connection con;
   int recursion            = 0;
-  OOB_callback *oob_ptr    = nullptr;
   bool from_accept_thread  = false;
   NetAccept *accept_object = nullptr;
 
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 50f3700..27c76bc 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -971,8 +971,6 @@ SSLNetVConnection::free(EThread *t)
 {
   ink_release_assert(t == this_ethread());
 
-  // cancel OOB
-  cancel_OOB();
   // close socket fd
   if (con.fd != NO_FD) {
     NET_SUM_GLOBAL_DYN_STAT(net_connections_currently_open_stat, -1);
diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index b253f81..8d1f382 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -732,63 +732,6 @@ UnixNetVConnection::do_io_shutdown(ShutdownHowTo_t howto)
   }
 }
 
-int
-OOB_callback::retry_OOB_send(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED */)
-{
-  ink_assert(mutex->thread_holding == this_ethread());
-  // the NetVC and the OOB_callback share a mutex
-  server_vc->oob_ptr = nullptr;
-  server_vc->send_OOB(server_cont, data, length);
-  delete this;
-  return EVENT_DONE;
-}
-
-void
-UnixNetVConnection::cancel_OOB()
-{
-  UnixNetVConnection *u = this;
-  if (u->oob_ptr) {
-    if (u->oob_ptr->trigger) {
-      u->oob_ptr->trigger->cancel_action();
-      u->oob_ptr->trigger = nullptr;
-    }
-    delete u->oob_ptr;
-    u->oob_ptr = nullptr;
-  }
-}
-
-Action *
-UnixNetVConnection::send_OOB(Continuation *cont, char *buf, int len)
-{
-  UnixNetVConnection *u = this;
-  ink_assert(len > 0);
-  ink_assert(buf);
-  ink_assert(!u->oob_ptr);
-  int written;
-  ink_assert(cont->mutex->thread_holding == this_ethread());
-  written = socketManager.send(u->con.fd, buf, len, MSG_OOB);
-  if (written == len) {
-    cont->handleEvent(VC_EVENT_OOB_COMPLETE, nullptr);
-    return ACTION_RESULT_DONE;
-  } else if (!written) {
-    cont->handleEvent(VC_EVENT_EOS, nullptr);
-    return ACTION_RESULT_DONE;
-  }
-  if (written > 0 && written < len) {
-    u->oob_ptr          = new OOB_callback(mutex, this, cont, buf + written, len - written);
-    u->oob_ptr->trigger = mutex->thread_holding->schedule_in_local(u->oob_ptr,
HRTIME_MSECONDS(10));
-    return u->oob_ptr->trigger;
-  } else {
-    // should be a rare case : taking a new continuation should not be
-    // expensive for this
-    written = -errno;
-    ink_assert(written == -EAGAIN || written == -ENOTCONN);
-    u->oob_ptr          = new OOB_callback(mutex, this, cont, buf, len);
-    u->oob_ptr->trigger = mutex->thread_holding->schedule_in_local(u->oob_ptr,
HRTIME_MSECONDS(10));
-    return u->oob_ptr->trigger;
-  }
-}
-
 //
 // Function used to reenable the VC for reading or
 // writing.
@@ -1339,8 +1282,6 @@ UnixNetVConnection::free(EThread *t)
 {
   ink_release_assert(t == this_ethread());
 
-  // cancel OOB
-  cancel_OOB();
   // close socket fd
   if (con.fd != NO_FD) {
     NET_SUM_GLOBAL_DYN_STAT(net_connections_currently_open_stat, -1);

Mime
View raw message