Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Linux programozás nagyházi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eckl, Máté
Linux programozás nagyházi
Commits
a89c859f
Commit
a89c859f
authored
May 26, 2016
by
dnsadmin
Browse files
Options
Downloads
Patches
Plain Diff
Kis kiegészítő funkció (
#8
)
parent
12089093
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.cpp
+9
-2
9 additions, 2 deletions
main.cpp
src/dns_server.cpp
+1
-0
1 addition, 0 deletions
src/dns_server.cpp
with
10 additions
and
2 deletions
main.cpp
+
9
−
2
View file @
a89c859f
...
...
@@ -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
,
"dmskvh
t:
"
))
!=
-
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
...
...
This diff is collapsed.
Click to expand it.
src/dns_server.cpp
+
1
−
0
View file @
a89c859f
...
...
@@ -168,4 +168,5 @@ void dns_server::serve_in_threads(int n) {
stop
();
throw
;
}
log_on_demand
(
LOG_INFO
,
"%d thread(s) started."
,
n
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment