mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
51b247bfac
This commit continues the complete replacement of the spaghetti code mess that was inside daemon/ and daemonize/ which started in #1138, and looked like a entry level Java programmer threw up inside the code base. This greatly simplifies it, removing a whole pile of useless abstraction layers that don't actually abstract anything, and results in considerably simpler code. (Many of the changes here were also carried out in #1138; this commit updates them with the merged result which amends some things from that PR and goes further in some places). In detail: - the `--detach` (and related `--pidfile`) options are gone. (--detach is still handled, but now just prints a fatal error). Detaching a process is an archaic unix mechanism that has no place on a modern system. If you *really* want to do it anyway, `nohup lokid &` will do the job. (The Windows service control code, which is probably seldom used, is kept because it seems potentially useful for Windows users). - Many of the `t_whatever` classes in daemon/* are just deleted (mostly done in #1138); each one was a bunch of junk code that wraps 3-4 lines but forces an extra layer (not even a generic abstraction, just a useless wrapper) for no good reason and made the daemon code painfully hard to understand and work with. - All of the remaining `t_whatever` classes in daemon/* are either renamed to `whatever` (because prefixing every class with `t_` is moronic). - Some stupid related code (e.g. epee's command handler returning an unsuitable "usage" string that has to be string modified into what we want) was replaced with more generic, useful code. - Replaced boost mutexes/cvs with std ones in epee command handler, and deleted some commented out code. - The `--public-node` option handling was terrible: it was being handled in main, but main doesn't know anything about options, so then it forced it through the spaghetti objects *beside* the pack of all options that got passed along. Moved it to a more sane location (core_rpc_server) and parse it out with some sanity. - Changed a bunch of std::bind's to lambdas because, at least for small lambdas (i.e. with only one-or-two pointers for captures) they will generally be more efficient as the values can be stored in std::function's without any memory allocations. |
||
---|---|---|
.. | ||
net | ||
serialization | ||
storages | ||
ado_db_helper.h | ||
console_handler.h | ||
copyable_atomic.h | ||
file_io_utils.h | ||
fnv1.h | ||
global_stream_operators.h | ||
gzip_encoding.h | ||
hex.h | ||
hmac-md5.h | ||
include_base_utils.h | ||
int-util.h | ||
math_helper.h | ||
md5_l.h | ||
md5_l.inl | ||
md5global.h | ||
memwipe.h | ||
misc_language.h | ||
misc_log_ex.h | ||
misc_os_dependent.h | ||
mlocker.h | ||
pragma_comp_defs.h | ||
profile_tools.h | ||
readline_buffer.h | ||
reg_exp_definer.h | ||
reg_utils.h | ||
rolling_median.h | ||
service_impl_base.h | ||
sha1.h | ||
sha1.inl | ||
soci_helper.h | ||
span.h | ||
static_initializer.h | ||
stats.h | ||
stats.inl | ||
string_coding.h | ||
string_tools.h | ||
syncobj.h | ||
time_helper.h | ||
tiny_ini.h | ||
to_nonconst_iterator.h | ||
warnings.h | ||
winobj.h | ||
wipeable_string.h | ||
zlib_helper.h |