Skip to content

Commit 3116856

Browse files
authored
Remove accept_fn from NetAccept (#12194)
1 parent 1f78f5d commit 3116856

4 files changed

Lines changed: 4 additions & 11 deletions

File tree

src/iocore/net/P_NetAccept.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ struct NetAcceptAction : public Action, public RefCountObjInHeap {
9191
struct NetAccept : public Continuation {
9292
ink_hrtime period = 0;
9393
Server server;
94-
AcceptFunctionPtr accept_fn = nullptr;
95-
int ifd = NO_FD;
96-
int id = -1;
94+
int ifd = NO_FD;
95+
int id = -1;
9796
Ptr<NetAcceptAction> action_;
9897
SSLNextProtocolAccept *snpa = nullptr;
9998
NetAcceptEventIO ep;

src/iocore/net/QUICNetProcessor.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ QUICNetProcessor::main_accept(Continuation *cont, SOCKET fd, AcceptOptions const
248248
ink_assert(0 < opt.local_port && opt.local_port < 65536);
249249
accept_ip.network_order_port() = htons(opt.local_port);
250250

251-
na->accept_fn = net_accept;
252251
na->server.sock = UnixSocket{fd};
253252
ats_ip_copy(&na->server.accept_addr, &accept_ip);
254253

src/iocore/net/UnixNetAccept.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,7 @@ NetAccept::accept_per_thread(int /* event ATS_UNUSED */, void * /* ep ATS_UNUSED
272272
}
273273
}
274274

275-
if (accept_fn == net_accept) {
276-
SET_HANDLER(&NetAccept::acceptFastEvent);
277-
} else {
278-
SET_HANDLER(&NetAccept::acceptEvent);
279-
}
275+
SET_HANDLER(&NetAccept::acceptFastEvent);
280276
PollDescriptor *pd = get_PollDescriptor(this_ethread());
281277
if (this->ep.start(pd, this, EVENTIO_READ) < 0) {
282278
Fatal("[NetAccept::accept_per_thread]:error starting EventIO");
@@ -483,7 +479,7 @@ NetAccept::acceptEvent(int event, void *ep)
483479
}
484480

485481
int res;
486-
if ((res = accept_fn(this, e, false)) < 0) {
482+
if ((res = net_accept(this, e, false)) < 0) {
487483
Metrics::Gauge::decrement(net_rsb.accepts_currently_open);
488484
/* INKqa11179 */
489485
Warning("Accept on port %d failed with error no %d", ats_ip_port_host_order(&server.addr), res);

src/iocore/net/UnixNetProcessor.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ UnixNetProcessor::accept_internal(Continuation *cont, int fd, AcceptOptions cons
118118
ink_assert(opt.ip_family == AF_UNIX || (0 < opt.local_port && opt.local_port < 65536));
119119
accept_ip.network_order_port() = htons(opt.local_port);
120120

121-
na->accept_fn = net_accept; // All callers used this.
122121
na->server.sock = UnixSocket{fd};
123122
ats_ip_copy(&na->server.accept_addr, &accept_ip);
124123

0 commit comments

Comments
 (0)