Skip to content

Commit 059df6a

Browse files
committed
Get rid of AcceptOptions::etype
1 parent 24cf807 commit 059df6a

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

iocore/net/AcceptOptions.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "tscore/ink_inet.h"
2828

2929
#include "I_Event.h"
30-
#include "I_Net.h"
3130

3231
struct AcceptOptions {
3332
using self = AcceptOptions; ///< Self reference type.
@@ -44,13 +43,10 @@ struct AcceptOptions {
4443
int ip_family = AF_INET;
4544
/// Should we use accept threads? If so, how many?
4645
int accept_threads = -1;
47-
/// Event type to generate on accept.
48-
EventType etype = ET_NET;
4946
/** If @c true, the continuation is called back with
5047
@c NET_EVENT_ACCEPT_SUCCEED
5148
or @c NET_EVENT_ACCEPT_FAILED on success and failure resp.
5249
*/
53-
5450
bool localhost_only = false;
5551
/// Are frequent accepts expected?
5652
/// Default: @c false.

iocore/net/Connection.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Server::setup_fd_for_listen(bool non_blocking, const NetProcessor::AcceptOptions
145145

146146
ink_assert(fd != NO_FD);
147147

148-
if (opt.etype == ET_NET && opt.defer_accept > 0) {
148+
if (opt.defer_accept > 0) {
149149
http_accept_filter = true;
150150
add_http_filter(fd);
151151
}

iocore/net/QUICNetProcessor_quiche.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ QUICNetProcessor::connect_re(Continuation *cont, sockaddr const *remote_addr, Ne
190190
vc->mutex = cont->mutex;
191191
vc->action_ = cont;
192192

193-
if (t->is_event_type(opt.etype)) {
193+
if (t->is_event_type(ET_NET)) {
194194
MUTEX_TRY_LOCK(lock, cont->mutex, t);
195195
if (lock.is_locked()) {
196196
MUTEX_TRY_LOCK(lock2, get_NetHandler(t)->mutex, t);
@@ -202,10 +202,10 @@ QUICNetProcessor::connect_re(Continuation *cont, sockaddr const *remote_addr, Ne
202202
}
203203

204204
// Try to stay on the current thread if it is the right type
205-
if (t->is_event_type(opt.etype)) {
205+
if (t->is_event_type(ET_NET)) {
206206
t->schedule_imm(vc);
207207
} else { // Otherwise, pass along to another thread of the right type
208-
eventProcessor.schedule_imm(vc, opt.etype);
208+
eventProcessor.schedule_imm(vc, ET_NET);
209209
}
210210

211211
return ACTION_RESULT_DONE;

iocore/net/UnixNetAccept.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ net_accept(NetAccept *na, void *ep, bool blockable)
103103

104104
EThread *t;
105105
NetHandler *h;
106-
if (e->ethread->is_event_type(na->opt.etype)) {
106+
if (e->ethread->is_event_type(ET_NET)) {
107107
t = e->ethread;
108108
h = get_NetHandler(t);
109109
// Assign NetHandler->mutex to NetVC
@@ -115,7 +115,7 @@ net_accept(NetAccept *na, void *ep, bool blockable)
115115
vc->handleEvent(EVENT_NONE, e);
116116
}
117117
} else {
118-
t = eventProcessor.assign_thread(na->opt.etype);
118+
t = eventProcessor.assign_thread(ET_NET);
119119
h = get_NetHandler(t);
120120
// Assign NetHandler->mutex to NetVC
121121
vc->mutex = h->mutex;
@@ -178,7 +178,7 @@ void
178178
NetAccept::init_accept(EThread *t)
179179
{
180180
if (!t) {
181-
t = eventProcessor.assign_thread(opt.etype);
181+
t = eventProcessor.assign_thread(ET_NET);
182182
}
183183

184184
if (!action_->continuation->mutex) {
@@ -227,7 +227,6 @@ NetAccept::init_accept_per_thread()
227227
int i, n;
228228
int listen_per_thread = 0;
229229

230-
ink_assert(opt.etype >= 0);
231230
REC_ReadConfigInteger(listen_per_thread, "proxy.config.exec_thread.listen");
232231

233232
if (listen_per_thread == 0) {
@@ -238,11 +237,11 @@ NetAccept::init_accept_per_thread()
238237
}
239238

240239
SET_HANDLER(&NetAccept::accept_per_thread);
241-
n = eventProcessor.thread_group[opt.etype]._count;
240+
n = eventProcessor.thread_group[ET_NET]._count;
242241

243242
for (i = 0; i < n; i++) {
244243
NetAccept *a = (i < n - 1) ? clone() : this;
245-
EThread *t = eventProcessor.thread_group[opt.etype]._thread[i];
244+
EThread *t = eventProcessor.thread_group[ET_NET]._thread[i];
246245
a->mutex = get_NetHandler(t)->mutex;
247246
t->schedule_imm(a);
248247
}
@@ -364,7 +363,7 @@ NetAccept::do_blocking_accept(EThread *t)
364363
#endif
365364
SET_CONTINUATION_HANDLER(vc, &UnixNetVConnection::acceptEvent);
366365

367-
EThread *localt = eventProcessor.assign_thread(opt.etype);
366+
EThread *localt = eventProcessor.assign_thread(ET_NET);
368367
NetHandler *h = get_NetHandler(localt);
369368
// Assign NetHandler->mutex to NetVC
370369
vc->mutex = h->mutex;

src/traffic_quic/quic_client.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ QUICClient::start(int, void *)
7878
NetVCOptions opt;
7979
opt.ip_proto = NetVCOptions::USE_UDP;
8080
opt.ip_family = info->ai_family;
81-
opt.etype = ET_NET;
8281
opt.socket_recv_bufsize = 1048576;
8382
opt.socket_send_bufsize = 1048576;
8483
opt.alpn_protos = alpn_protos;

0 commit comments

Comments
 (0)