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
a507fc80
Commit
a507fc80
authored
Aug 17, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Isolate std::future when NOTHREADS is defined and build without SOCK_{NONBLOCK, CLOEXEC}
parent
69c3920a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
src/shrpx.h
src/shrpx.h
+11
-0
src/shrpx_listen_handler.cc
src/shrpx_listen_handler.cc
+6
-0
src/shrpx_listen_handler.h
src/shrpx_listen_handler.h
+4
-0
No files found.
src/shrpx.h
View file @
a507fc80
...
...
@@ -29,10 +29,21 @@
# include <config.h>
#endif // HAVE_CONFIG_H
#include <sys/types.h>
#include <sys/socket.h>
#include <cassert>
#include "shrpx_log.h"
#ifndef SOCK_NONBLOCK
#define SOCK_NONBLOCK 0
#endif // !SOCK_NONBLOCK
#ifndef SOCK_CLOEXEC
#define SOCK_CLOEXEC 0
#endif // !SOCK_CLOEXEC
#define DIE() \
assert(0);
...
...
src/shrpx_listen_handler.cc
View file @
a507fc80
...
...
@@ -75,6 +75,7 @@ void ListenHandler::worker_reopen_log_files()
}
}
#ifndef NOTHREADS
namespace
{
void
worker_writecb
(
bufferevent
*
bev
,
void
*
ptr
)
{
...
...
@@ -96,9 +97,11 @@ void worker_writecb(bufferevent *bev, void *ptr)
bufferevent_disable
(
bev
,
EV_READ
|
EV_WRITE
);
}
}
// namespace
#endif // NOTHREADS
void
ListenHandler
::
create_worker_thread
(
size_t
num
)
{
#ifndef NOTHREADS
workers_
.
resize
(
0
);
for
(
size_t
i
=
0
;
i
<
num
;
++
i
)
{
int
rv
;
...
...
@@ -137,10 +140,12 @@ void ListenHandler::create_worker_thread(size_t num)
LLOG
(
INFO
,
this
)
<<
"Created thread #"
<<
workers_
.
size
()
-
1
;
}
}
#endif // NOTHREADS
}
void
ListenHandler
::
join_worker
()
{
#ifndef NOTHREADS
int
n
=
0
;
if
(
LOG_ENABLED
(
INFO
))
{
...
...
@@ -155,6 +160,7 @@ void ListenHandler::join_worker()
}
++
n
;
}
#endif // NOTHREADS
}
void
ListenHandler
::
graceful_shutdown_worker
()
...
...
src/shrpx_listen_handler.h
View file @
a507fc80
...
...
@@ -32,7 +32,9 @@
#include <memory>
#include <vector>
#ifndef NOTHREADS
#include <future>
#endif // NOTHREADS
#include <openssl/ssl.h>
...
...
@@ -43,7 +45,9 @@
namespace
shrpx
{
struct
WorkerInfo
{
#ifndef NOTHREADS
std
::
future
<
void
>
fut
;
#endif // NOTHREADS
SSL_CTX
*
sv_ssl_ctx
;
SSL_CTX
*
cl_ssl_ctx
;
bufferevent
*
bev
;
...
...
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