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 2017/05/24 16:13:19 UTC

[trafficserver] branch master updated: Deprecated VConnection do_io

This is an automated email from the ASF dual-hosted git repository.

amc 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  b594786   Deprecated VConnection do_io
b594786 is described below

commit b594786152d746d52c80d024b8ca92d59275c3d1
Author: Unknown <aa...@gmail.com>
AuthorDate: Tue May 23 16:54:33 2017 -0500

    Deprecated VConnection do_io
    
    Replaced all calls to do_io(VIO::ENUM, ...) with matching do_io_*(...).
---
 iocore/eventsystem/I_VConnection.h  |  3 ---
 iocore/eventsystem/P_VConnection.h  | 40 -------------------------------------
 iocore/net/SSLNextProtocolAccept.cc |  8 ++++----
 iocore/utils/OneWayMultiTunnel.cc   |  6 +++---
 iocore/utils/OneWayTunnel.cc        |  4 ++--
 proxy/InkAPI.cc                     |  2 +-
 proxy/TestSimpleProxy.cc            |  8 ++++----
 proxy/http/HttpCacheSM.h            |  8 ++++----
 proxy/http/HttpSM.cc                |  7 ++++---
 9 files changed, 22 insertions(+), 64 deletions(-)

diff --git a/iocore/eventsystem/I_VConnection.h b/iocore/eventsystem/I_VConnection.h
index b6721aa..27c6d97 100644
--- a/iocore/eventsystem/I_VConnection.h
+++ b/iocore/eventsystem/I_VConnection.h
@@ -312,9 +312,6 @@ public:
   VConnection(ProxyMutex *aMutex);
   VConnection(Ptr<ProxyMutex> &aMutex);
 
-  /** @deprecated */
-  VIO *do_io(int op, Continuation *c = nullptr, int64_t nbytes = INT64_MAX, MIOBuffer *buf = 0, int data = 0);
-
   // Private
   // Set continuation on a given vio. The public interface
   // is through VIO::set_continuation()
diff --git a/iocore/eventsystem/P_VConnection.h b/iocore/eventsystem/P_VConnection.h
index ac8fbfc..a9eea74 100644
--- a/iocore/eventsystem/P_VConnection.h
+++ b/iocore/eventsystem/P_VConnection.h
@@ -71,18 +71,6 @@ VConnection::~VConnection()
 {
 }
 
-//////////////////////////////////////////////////////////////////////////////
-//
-//      DEPRECATED DEPRECATED DEPRECATED
-//
-//      inline VIO * VConnection::do_io()
-//
-//      This method enqueues a VIO operation onto the VIO queue, and
-//      activates the I/O operation if and operation of that type isn't
-//      already underway.
-//
-//////////////////////////////////////////////////////////////////////////////
-
 TS_INLINE VIO *
 vc_do_io_write(VConnection *vc, Continuation *cont, int64_t nbytes, MIOBuffer *buf, int64_t offset)
 {
@@ -94,34 +82,6 @@ vc_do_io_write(VConnection *vc, Continuation *cont, int64_t nbytes, MIOBuffer *b
   return vc->do_io_write(cont, nbytes, reader, true);
 }
 
-TS_INLINE VIO *
-VConnection::do_io(int op, Continuation *c, int64_t nbytes, MIOBuffer *cb, int data)
-{
-  switch (op) {
-  case VIO::READ:
-    return do_io_read(c, nbytes, cb);
-  case VIO::WRITE:
-    return vc_do_io_write(this, c, nbytes, cb, data);
-  case VIO::CLOSE:
-    do_io_close();
-    return nullptr;
-  case VIO::ABORT:
-    do_io_close(data);
-    return nullptr;
-  case VIO::SHUTDOWN_READ:
-    do_io_shutdown(IO_SHUTDOWN_READ);
-    return nullptr;
-  case VIO::SHUTDOWN_WRITE:
-    do_io_shutdown(IO_SHUTDOWN_WRITE);
-    return nullptr;
-  case VIO::SHUTDOWN_READWRITE:
-    do_io_shutdown(IO_SHUTDOWN_READWRITE);
-    return nullptr;
-  }
-  ink_assert(!"cannot use default implementation for do_io operation");
-  return nullptr;
-}
-
 TS_INLINE void
 VConnection::set_continuation(VIO *, Continuation *)
 {
diff --git a/iocore/net/SSLNextProtocolAccept.cc b/iocore/net/SSLNextProtocolAccept.cc
index 5ec4d72..cdcbf4a 100644
--- a/iocore/net/SSLNextProtocolAccept.cc
+++ b/iocore/net/SSLNextProtocolAccept.cc
@@ -85,7 +85,7 @@ struct SSLNextProtocolTrampoline : public Continuation {
     case VC_EVENT_INACTIVITY_TIMEOUT:
       // Cancel the read before we have a chance to delete the continuation
       netvc->do_io_read(nullptr, 0, nullptr);
-      netvc->do_io(VIO::CLOSE);
+      netvc->do_io_close();
       delete this;
       return EVENT_ERROR;
     case VC_EVENT_READ_COMPLETE:
@@ -109,7 +109,7 @@ struct SSLNextProtocolTrampoline : public Continuation {
       send_plugin_event(npnParent->endpoint, NET_EVENT_ACCEPT, netvc);
     } else {
       // No handler, what should we do? Best to just kill the VC while we can.
-      netvc->do_io(VIO::CLOSE);
+      netvc->do_io_close();
     }
 
     delete this;
@@ -136,10 +136,10 @@ SSLNextProtocolAccept::mainEvent(int event, void *edata)
     // the endpoint that there is an accept to handle until the read completes
     // and we know which protocol was negotiated.
     netvc->registerNextProtocolSet(&this->protoset);
-    netvc->do_io(VIO::READ, new SSLNextProtocolTrampoline(this, netvc->mutex), 0, this->buffer, 0);
+    netvc->do_io_read(new SSLNextProtocolTrampoline(this, netvc->mutex), 0, this->buffer);
     return EVENT_CONT;
   default:
-    netvc->do_io(VIO::CLOSE);
+    netvc->do_io_close();
     return EVENT_DONE;
   }
 }
diff --git a/iocore/utils/OneWayMultiTunnel.cc b/iocore/utils/OneWayMultiTunnel.cc
index 4de8523..23408d2 100644
--- a/iocore/utils/OneWayMultiTunnel.cc
+++ b/iocore/utils/OneWayMultiTunnel.cc
@@ -95,11 +95,11 @@ OneWayMultiTunnel::init(VConnection *vcSource, VConnection **vcTargets, int n_vc
 
   buf1->water_mark = water_mark;
 
-  vioSource = vcSource->do_io(VIO::READ, this, nbytes, buf1, 0);
+  vioSource = vcSource->do_io_read(this, nbytes, buf1);
 
   ink_assert(n_vcTargets <= ONE_WAY_MULTI_TUNNEL_LIMIT);
   for (int i      = 0; i < n_vcTargets; i++)
-    vioTargets[i] = vcTargets[i]->do_io(VIO::WRITE, this, INT64_MAX, buf2, 0);
+    vioTargets[i] = vc_do_io_write(vcTargets[i], this, INT64_MAX, buf2, 0);
 
   return;
 }
@@ -235,7 +235,7 @@ OneWayMultiTunnel::close_target_vio(int result, VIO *vio)
       if (last_connection() || !single_buffer)
         free_MIOBuffer(v->buffer.writer());
       if (close_target)
-        v->vc_server->do_io(result ? VIO::ABORT : VIO::CLOSE);
+        v->vc_server->do_io_close();
       vioTargets[i] = nullptr;
       n_connections--;
     }
diff --git a/iocore/utils/OneWayTunnel.cc b/iocore/utils/OneWayTunnel.cc
index 97e5ea0..d45e5f1 100644
--- a/iocore/utils/OneWayTunnel.cc
+++ b/iocore/utils/OneWayTunnel.cc
@@ -179,10 +179,10 @@ OneWayTunnel::init(VConnection *vcSource, VConnection *vcTarget, Continuation *a
   close_target     = aclose_target;
   tunnel_till_done = true;
 
-  // Prior to constructing the OneWayTunnel, we initiated a do_io(VIO::READ)
+  // Prior to constructing the OneWayTunnel, we initiated a do_io_read()
   // on the source VC.  We wish to use the same MIO buffer in the tunnel.
 
-  // do_io() read already posted on vcSource.
+  // do_io_read() already posted on vcSource.
   SET_HANDLER(&OneWayTunnel::startEvent);
 
   SourceVio->set_continuation(this);
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index f841281..67dbb40 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -6554,7 +6554,7 @@ TSVConnRead(TSVConn connp, TSCont contp, TSIOBuffer bufp, int64_t nbytes)
   FORCE_PLUGIN_SCOPED_MUTEX(contp);
   VConnection *vc = (VConnection *)connp;
 
-  return reinterpret_cast<TSVIO>(vc->do_io(VIO::READ, (INKContInternal *)contp, nbytes, (MIOBuffer *)bufp));
+  return reinterpret_cast<TSVIO>(vc->do_io_read((INKContInternal *)contp, nbytes, (MIOBuffer *)bufp));
 }
 
 TSVIO
diff --git a/proxy/TestSimpleProxy.cc b/proxy/TestSimpleProxy.cc
index cc73a00..67dff51 100644
--- a/proxy/TestSimpleProxy.cc
+++ b/proxy/TestSimpleProxy.cc
@@ -44,9 +44,9 @@ struct TestProxy : Continuation {
     if (outbuf)
       free_MIOBuffer(outbuf);
     if (vc)
-      vc->do_io(VIO::CLOSE);
+      vc->do_io_close();
     if (remote)
-      remote->do_io(VIO::CLOSE);
+      remote->do_io_close();
     delete this;
     return EVENT_DONE;
   }
@@ -94,7 +94,7 @@ struct TestProxy : Continuation {
     }
     remote = aremote;
     outbuf = new_MIOBuffer();
-    remote->do_io(VIO::WRITE, this, INT64_MAX, outbuf);
+    remote->do_io_write(this, INT64_MAX, outbuf);
     *url_end = 0;
     sprintf(outbuf->start, "GET %s HTTP/1.0\n\n\n", url);
     outbuf->fill(strlen(outbuf->start) + 1);
@@ -143,7 +143,7 @@ struct TestAccept : Continuation {
   {
     if (!event) {
       MIOBuffer *buf = new_MIOBuffer();
-      e->do_io(VIO::READ, new TestProxy(buf), INT64_MAX, buf);
+      e->do_io_read(new TestProxy(buf), INT64_MAX, buf);
     } else {
       printf("TestAccept error %d\n", event);
       return EVENT_DONE;
diff --git a/proxy/http/HttpCacheSM.h b/proxy/http/HttpCacheSM.h
index 4037d78..b72d438 100644
--- a/proxy/http/HttpCacheSM.h
+++ b/proxy/http/HttpCacheSM.h
@@ -143,7 +143,7 @@ public:
   {
     if (cache_read_vc) {
       HTTP_DECREMENT_DYN_STAT(http_current_cache_connections_stat);
-      cache_read_vc->do_io(VIO::ABORT);
+      cache_read_vc->do_io_close(); // abort
       cache_read_vc = NULL;
     }
   }
@@ -152,7 +152,7 @@ public:
   {
     if (cache_write_vc) {
       HTTP_DECREMENT_DYN_STAT(http_current_cache_connections_stat);
-      cache_write_vc->do_io(VIO::ABORT);
+      cache_write_vc->do_io_close(); // abort
       cache_write_vc = NULL;
     }
   }
@@ -161,7 +161,7 @@ public:
   {
     if (cache_write_vc) {
       HTTP_DECREMENT_DYN_STAT(http_current_cache_connections_stat);
-      cache_write_vc->do_io(VIO::CLOSE);
+      cache_write_vc->do_io_close();
       cache_write_vc = NULL;
     }
   }
@@ -170,7 +170,7 @@ public:
   {
     if (cache_read_vc) {
       HTTP_DECREMENT_DYN_STAT(http_current_cache_connections_stat);
-      cache_read_vc->do_io(VIO::CLOSE);
+      cache_read_vc->do_io_close();
       cache_read_vc = NULL;
     }
   }
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 70b885f..c74b1a8 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -3383,7 +3383,8 @@ HttpSM::tunnel_handler_cache_write(int event, HttpTunnelConsumer *c)
     } else {
       *status_ptr      = HttpTransact::CACHE_WRITE_COMPLETE;
       c->write_success = true;
-      c->write_vio     = c->vc->do_io(VIO::CLOSE);
+      c->vc->do_io_close();
+      c->write_vio = nullptr;
     }
     break;
   default:
@@ -3796,7 +3797,7 @@ HttpSM::tunnel_handler_transform_write(int event, HttpTunnelConsumer *c)
       //   has already completed (possible when the
       //   transform intentionally truncates the response).
       //   So close it
-      c->vc->do_io(VIO::CLOSE);
+      c->vc->do_io_close();
     }
     break;
   default:
@@ -3891,7 +3892,7 @@ HttpSM::tunnel_handler_plugin_agent(int event, HttpTunnelConsumer *c)
   // FALLTHROUGH
   case VC_EVENT_WRITE_COMPLETE:
     c->write_success = true;
-    c->vc->do_io(VIO::CLOSE);
+    c->vc->do_io_close();
     break;
   default:
     ink_release_assert(0);

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].