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
7b85f6c5
Commit
7b85f6c5
authored
Aug 13, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Store errno to a variable temporarly
parent
21cbf417
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
src/shrpx.cc
src/shrpx.cc
+6
-3
src/shrpx_http2_session.cc
src/shrpx_http2_session.cc
+4
-2
src/shrpx_listen_handler.cc
src/shrpx_listen_handler.cc
+2
-1
No files found.
src/shrpx.cc
View file @
7b85f6c5
...
...
@@ -287,11 +287,13 @@ void drop_privileges()
{
if
(
getuid
()
==
0
&&
get_config
()
->
uid
!=
0
)
{
if
(
setgid
(
get_config
()
->
gid
)
!=
0
)
{
LOG
(
FATAL
)
<<
"Could not change gid: "
<<
strerror
(
errno
);
auto
error
=
errno
;
LOG
(
FATAL
)
<<
"Could not change gid: "
<<
strerror
(
error
);
exit
(
EXIT_FAILURE
);
}
if
(
setuid
(
get_config
()
->
uid
)
!=
0
)
{
LOG
(
FATAL
)
<<
"Could not change uid: "
<<
strerror
(
errno
);
auto
error
=
errno
;
LOG
(
FATAL
)
<<
"Could not change uid: "
<<
strerror
(
error
);
exit
(
EXIT_FAILURE
);
}
if
(
setuid
(
0
)
!=
-
1
)
{
...
...
@@ -527,7 +529,8 @@ int event_loop()
auto
listener_handler
=
new
ListenHandler
(
evbase
,
sv_ssl_ctx
,
cl_ssl_ctx
);
if
(
get_config
()
->
daemon
)
{
if
(
daemon
(
0
,
0
)
==
-
1
)
{
LOG
(
FATAL
)
<<
"Failed to daemonize: "
<<
strerror
(
errno
);
auto
error
=
errno
;
LOG
(
FATAL
)
<<
"Failed to daemonize: "
<<
strerror
(
error
);
exit
(
EXIT_FAILURE
);
}
}
...
...
src/shrpx_http2_session.cc
View file @
7b85f6c5
...
...
@@ -196,7 +196,8 @@ int Http2Session::init_notification()
rv
=
socketpair
(
AF_UNIX
,
SOCK_STREAM
|
SOCK_NONBLOCK
|
SOCK_CLOEXEC
,
0
,
sockpair
);
if
(
rv
==
-
1
)
{
SSLOG
(
FATAL
,
this
)
<<
"socketpair() failed: errno="
<<
errno
;
auto
error
=
errno
;
SSLOG
(
FATAL
,
this
)
<<
"socketpair() failed: errno="
<<
error
;
return
-
1
;
}
...
...
@@ -277,8 +278,9 @@ void eventcb(bufferevent *bev, short events, void *ptr)
int
val
=
1
;
if
(
setsockopt
(
fd
,
IPPROTO_TCP
,
TCP_NODELAY
,
reinterpret_cast
<
char
*>
(
&
val
),
sizeof
(
val
))
==
-
1
)
{
auto
error
=
errno
;
SSLOG
(
WARNING
,
http2session
)
<<
"Setting option TCP_NODELAY failed: errno="
<<
err
no
;
<<
"Setting option TCP_NODELAY failed: errno="
<<
err
or
;
}
return
;
}
...
...
src/shrpx_listen_handler.cc
View file @
7b85f6c5
...
...
@@ -106,7 +106,8 @@ void ListenHandler::create_worker_thread(size_t num)
rv
=
socketpair
(
AF_UNIX
,
SOCK_STREAM
|
SOCK_NONBLOCK
|
SOCK_CLOEXEC
,
0
,
info
->
sv
);
if
(
rv
==
-
1
)
{
LLOG
(
ERROR
,
this
)
<<
"socketpair() failed: errno="
<<
errno
;
auto
error
=
errno
;
LLOG
(
ERROR
,
this
)
<<
"socketpair() failed: errno="
<<
error
;
continue
;
}
...
...
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