This is an automated email from the ASF dual-hosted git repository. cmcfarlen pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit f2d8fceaf0349afcc183b30efdfe0fc577388372 Author: Mo Chen <[email protected]> AuthorDate: Wed Apr 16 16:06:44 2025 -0500 Remove accept_fn from NetAccept (#12194) (cherry picked from commit 311685648fa31613f0a78b1c4334dbdd5dcf7578) --- src/iocore/net/P_NetAccept.h | 5 ++--- src/iocore/net/QUICNetProcessor.cc | 1 - src/iocore/net/UnixNetAccept.cc | 8 ++------ src/iocore/net/UnixNetProcessor.cc | 1 - 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/iocore/net/P_NetAccept.h b/src/iocore/net/P_NetAccept.h index 644ca7e06a..163d5578d5 100644 --- a/src/iocore/net/P_NetAccept.h +++ b/src/iocore/net/P_NetAccept.h @@ -91,9 +91,8 @@ struct NetAcceptAction : public Action, public RefCountObjInHeap { struct NetAccept : public Continuation { ink_hrtime period = 0; Server server; - AcceptFunctionPtr accept_fn = nullptr; - int ifd = NO_FD; - int id = -1; + int ifd = NO_FD; + int id = -1; Ptr<NetAcceptAction> action_; SSLNextProtocolAccept *snpa = nullptr; NetAcceptEventIO ep; diff --git a/src/iocore/net/QUICNetProcessor.cc b/src/iocore/net/QUICNetProcessor.cc index 267802e63f..b6b3b05093 100644 --- a/src/iocore/net/QUICNetProcessor.cc +++ b/src/iocore/net/QUICNetProcessor.cc @@ -248,7 +248,6 @@ QUICNetProcessor::main_accept(Continuation *cont, SOCKET fd, AcceptOptions const ink_assert(0 < opt.local_port && opt.local_port < 65536); accept_ip.network_order_port() = htons(opt.local_port); - na->accept_fn = net_accept; na->server.sock = UnixSocket{fd}; ats_ip_copy(&na->server.accept_addr, &accept_ip); diff --git a/src/iocore/net/UnixNetAccept.cc b/src/iocore/net/UnixNetAccept.cc index ee4d5bf94f..5bd3b3b6de 100644 --- a/src/iocore/net/UnixNetAccept.cc +++ b/src/iocore/net/UnixNetAccept.cc @@ -272,11 +272,7 @@ NetAccept::accept_per_thread(int /* event ATS_UNUSED */, void * /* ep ATS_UNUSED } } - if (accept_fn == net_accept) { - SET_HANDLER(&NetAccept::acceptFastEvent); - } else { - SET_HANDLER(&NetAccept::acceptEvent); - } + SET_HANDLER(&NetAccept::acceptFastEvent); PollDescriptor *pd = get_PollDescriptor(this_ethread()); if (this->ep.start(pd, this, EVENTIO_READ) < 0) { Fatal("[NetAccept::accept_per_thread]:error starting EventIO"); @@ -483,7 +479,7 @@ NetAccept::acceptEvent(int event, void *ep) } int res; - if ((res = accept_fn(this, e, false)) < 0) { + if ((res = net_accept(this, e, false)) < 0) { Metrics::Gauge::decrement(net_rsb.accepts_currently_open); /* INKqa11179 */ Warning("Accept on port %d failed with error no %d", ats_ip_port_host_order(&server.addr), res); diff --git a/src/iocore/net/UnixNetProcessor.cc b/src/iocore/net/UnixNetProcessor.cc index 504c56ea5f..82fcb43f89 100644 --- a/src/iocore/net/UnixNetProcessor.cc +++ b/src/iocore/net/UnixNetProcessor.cc @@ -118,7 +118,6 @@ UnixNetProcessor::accept_internal(Continuation *cont, int fd, AcceptOptions cons ink_assert(opt.ip_family == AF_UNIX || (0 < opt.local_port && opt.local_port < 65536)); accept_ip.network_order_port() = htons(opt.local_port); - na->accept_fn = net_accept; // All callers used this. na->server.sock = UnixSocket{fd}; ats_ip_copy(&na->server.accept_addr, &accept_ip);
