Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move {epoll, kqueue} (de)init logic and wakeup pipes logic out of CConnman and into EdgeTriggeredEvents and WakeupPipes #6007

Merged
9 commits merged into from
May 14, 2024
4 changes: 4 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ BITCOIN_CORE_H = \
util/bip32.h \
util/bytevectorhash.h \
util/check.h \
util/edge.h \
util/enumerate.h \
util/epochguard.h \
util/error.h \
Expand Down Expand Up @@ -362,6 +363,7 @@ BITCOIN_CORE_H = \
util/ui_change_type.h \
util/url.h \
util/vector.h \
util/wpipe.h \
validation.h \
validationinterface.h \
versionbits.h \
Expand Down Expand Up @@ -776,6 +778,7 @@ libbitcoin_util_a_SOURCES = \
util/bip32.cpp \
util/bytevectorhash.cpp \
util/check.cpp \
util/edge.cpp \
util/error.cpp \
util/fees.cpp \
util/hasher.cpp \
Expand All @@ -795,6 +798,7 @@ libbitcoin_util_a_SOURCES = \
util/thread.cpp \
util/threadnames.cpp \
util/tokenpipe.cpp \
util/wpipe.cpp \
$(BITCOIN_CORE_H)

if USE_LIBEVENT
Expand Down
20 changes: 3 additions & 17 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2515,23 +2515,9 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc
}
}

std::string strSocketEventsMode = args.GetArg("-socketevents", DEFAULT_SOCKETEVENTS);
if (strSocketEventsMode == "select") {
connOptions.socketEventsMode = CConnman::SOCKETEVENTS_SELECT;
#ifdef USE_POLL
} else if (strSocketEventsMode == "poll") {
connOptions.socketEventsMode = CConnman::SOCKETEVENTS_POLL;
#endif
#ifdef USE_EPOLL
} else if (strSocketEventsMode == "epoll") {
connOptions.socketEventsMode = CConnman::SOCKETEVENTS_EPOLL;
#endif
#ifdef USE_KQUEUE
} else if (strSocketEventsMode == "kqueue") {
connOptions.socketEventsMode = CConnman::SOCKETEVENTS_KQUEUE;
#endif
} else {
return InitError(strprintf(_("Invalid -socketevents ('%s') specified. Only these modes are supported: %s"), strSocketEventsMode, GetSupportedSocketEventsStr()));
std::string sem_str = args.GetArg("-socketevents", DEFAULT_SOCKETEVENTS);
if (SEMFromString(sem_str) == SocketEventsMode::Unknown) {
return InitError(strprintf(_("Invalid -socketevents ('%s') specified. Only these modes are supported: %s"), sem_str, GetSupportedSocketEventsStr()));
}

const std::string& i2psam_arg = args.GetArg("-i2psam", "");
Expand Down
Loading
Loading