Classes | |
struct | Parameters |
Typedefs | |
using | PrivilegeDowngradeData = std::tuple< uid_t, gid_t, std::vector< gid_t > > |
using | init_t = int(nawa::AppInit &) |
using | handleRequest_t = int(nawa::Connection &) |
Functions | |
unsigned int | getConcurrency (nawa::Config const &config) |
std::pair< init_t *, std::shared_ptr< nawa::HandleRequestFunctionWrapper > > | loadAppFunctions (nawa::Config const &config) |
void | reload (int signum) |
std::optional< PrivilegeDowngradeData > | preparePrivilegeDowngrade (nawa::Config const &config) |
void | replaceLogger (nawa::Log const &log) |
Parameters | parseCommandLine (int argc, char **argv) |
int | run (Parameters const ¶meters) |
struct nawarun::Parameters |
Class Members | ||
---|---|---|
typedef pair< string, string > | ConfigOptionId | |
typedef pair< ConfigOptionId, string > | ConfigOverride |
Class Members | ||
---|---|---|
optional< string > | configFile | |
vector< ConfigOverride > | configOverrides |
using nawarun::PrivilegeDowngradeData = typedef std::tuple<uid_t, gid_t, std::vector<gid_t> > |
using nawarun::init_t = typedef int(nawa::AppInit&) |
using nawarun::handleRequest_t = typedef int(nawa::Connection&) |
unsigned int nawarun::getConcurrency | ( | nawa::Config const & | config | ) |
Get the number of threads to use from config.
config | Config |
Definition at line 184 of file nawarun.cpp.
pair< init_t *, shared_ptr< HandleRequestFunctionWrapper > > nawarun::loadAppFunctions | ( | nawa::Config const & | config | ) |
Load the init() and handleRequest() functions of an app. Note: the init function also becomes unavailable when the HandleRequestFunctionWrapper is destructed. Throws a nawa::Exception on failure.
config | Config |
Definition at line 200 of file nawarun.cpp.
void nawarun::reload | ( | int | signum | ) |
optional< PrivilegeDowngradeData > nawarun::preparePrivilegeDowngrade | ( | nawa::Config const & | config | ) |
Prepare privilege downgrade considering the corresponding options in the config and check for errors. Will log warnings and throw a nawa::Exception in case of failure.
config | Config |
Definition at line 287 of file nawarun.cpp.
void nawarun::replaceLogger | ( | nawa::Log const & | log | ) |
Replace nawarun's logger with the given one for testing purposes.
log | Logger |
Definition at line 329 of file nawarun.cpp.
Parameters nawarun::parseCommandLine | ( | int | argc, |
char ** | argv | ||
) |
Parse command line arguments. If –help or -h is encountered as the first argument, printHelpAndExit() is invoked.
argc | Number of arguments |
argv | Arguments |
Parse command line arguments. If –help or -h is encountered as the first argument, printHelpAndExit() is invoked.
argc | Number of arguments |
argv | Arguments |
Definition at line 340 of file nawarun.cpp.
int nawarun::run | ( | Parameters const & | parameters | ) |
Run nawarun.
parameters | Parameters |
Definition at line 392 of file nawarun.cpp.