Skip to content
Snippets Groups Projects
Commit a89c859f authored by dnsadmin's avatar dnsadmin
Browse files

Kis kiegészítő funkció (#8)

parent 12089093
Branches
No related tags found
No related merge requests found
......@@ -31,10 +31,12 @@ void print_help();
int main(int argc, char *argv[])
{
int cli_option;
int thread_num = 1;
bool run_as_daemon = false;
std::vector<command> command_list;
while((cli_option = getopt (argc, argv, "dmskvh")) != -1)
while((cli_option = getopt (argc, argv, "dmskvht:")) != -1)
{
int ti = 0;
switch(cli_option)
{
case 'd':
......@@ -49,6 +51,11 @@ int main(int argc, char *argv[])
case 'v':
verbose = true;
break;
case 't':
ti = atoi(optarg);
if(ti>0)
thread_num = ti;
break;
case 'h':
print_help();
exit(EXIT_SUCCESS);
......@@ -145,7 +152,6 @@ int main(int argc, char *argv[])
// ----------------- INIT END --------------------------
// ------------------ SERVE ----------------------------
int thread_num = 8;
server.serve_in_threads(thread_num);
bool stop = false;
while(!stop)
......@@ -173,6 +179,7 @@ For more info look at the man page.
Options:
-d Run as daemon
-t Number of threads to start. Only makes sense with -d.
-s Statistics from daemon
-k Kill daemon
-v Verbose
......
......@@ -168,4 +168,5 @@ void dns_server::serve_in_threads(int n) {
stop();
throw;
}
log_on_demand(LOG_INFO, "%d thread(s) started.", n);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment