Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
c7ce6d81
Commit
c7ce6d81
authored
Oct 02, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/shrpx_config.cc: Code cleanup
parent
d90e0d42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/shrpx_config.cc
src/shrpx_config.cc
+6
-6
No files found.
src/shrpx_config.cc
View file @
c7ce6d81
...
...
@@ -102,7 +102,7 @@ const char SHRPX_OPT_WRITE_BURST[] = "write-burst";
const
char
SHRPX_OPT_NPN_LIST
[]
=
"npn-list"
;
namespace
{
Config
*
config
=
0
;
Config
*
config
=
nullptr
;
}
// namespace
const
Config
*
get_config
()
...
...
@@ -308,8 +308,8 @@ int parse_config(const char *opt, const char *optarg)
}
else
if
(
util
::
strieq
(
opt
,
SHRPX_OPT_PID_FILE
))
{
set_config_str
(
&
mod_config
()
->
pid_file
,
optarg
);
}
else
if
(
util
::
strieq
(
opt
,
SHRPX_OPT_USER
))
{
passwd
*
pwd
=
getpwnam
(
optarg
);
if
(
pwd
==
0
)
{
auto
pwd
=
getpwnam
(
optarg
);
if
(
!
pwd
)
{
LOG
(
ERROR
)
<<
"--user: failed to get uid from "
<<
optarg
<<
": "
<<
strerror
(
errno
);
return
-
1
;
...
...
@@ -319,7 +319,7 @@ int parse_config(const char *opt, const char *optarg)
}
else
if
(
util
::
strieq
(
opt
,
SHRPX_OPT_PRIVATE_KEY_FILE
))
{
set_config_str
(
&
mod_config
()
->
private_key_file
,
optarg
);
}
else
if
(
util
::
strieq
(
opt
,
SHRPX_OPT_PRIVATE_KEY_PASSWD_FILE
))
{
std
::
string
passwd
=
read_passwd_from_file
(
optarg
);
auto
passwd
=
read_passwd_from_file
(
optarg
);
if
(
passwd
.
empty
())
{
LOG
(
ERROR
)
<<
"Couldn't read key file's passwd from "
<<
optarg
;
return
-
1
;
...
...
@@ -335,7 +335,7 @@ int parse_config(const char *opt, const char *optarg)
if
(
sp
)
{
std
::
string
keyfile
(
optarg
,
sp
);
// TODO Do we need private key for subcert?
SSL_CTX
*
ssl_ctx
=
ssl
::
create_ssl_context
(
keyfile
.
c_str
(),
sp
+
1
);
auto
ssl_ctx
=
ssl
::
create_ssl_context
(
keyfile
.
c_str
(),
sp
+
1
);
if
(
!
get_config
()
->
cert_tree
)
{
mod_config
()
->
cert_tree
=
ssl
::
cert_lookup_tree_new
();
}
...
...
@@ -444,7 +444,7 @@ int load_config(const char *filename)
return
-
1
;
}
line
[
i
]
=
'\0'
;
const
char
*
s
=
line
.
c_str
();
auto
s
=
line
.
c_str
();
if
(
parse_config
(
s
,
s
+
i
+
1
)
==
-
1
)
{
return
-
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment