Merge branch 'master' into nghttpx-mruby
This commit is contained in:
commit
4ad00200a2
|
@ -130,6 +130,13 @@ ConnectionHandler::~ConnectionHandler() {
|
||||||
}
|
}
|
||||||
SSL_CTX_free(ssl_ctx);
|
SSL_CTX_free(ssl_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Free workers before destroying ev_loop
|
||||||
|
workers_.clear();
|
||||||
|
|
||||||
|
for (auto loop : worker_loops_) {
|
||||||
|
ev_loop_destroy(loop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionHandler::set_ticket_keys_to_worker(
|
void ConnectionHandler::set_ticket_keys_to_worker(
|
||||||
|
@ -193,6 +200,7 @@ int ConnectionHandler::create_worker_thread(size_t num) {
|
||||||
#endif // HAVE_MRUBY
|
#endif // HAVE_MRUBY
|
||||||
|
|
||||||
workers_.push_back(std::move(worker));
|
workers_.push_back(std::move(worker));
|
||||||
|
worker_loops_.push_back(loop);
|
||||||
|
|
||||||
if (LOG_ENABLED(INFO)) {
|
if (LOG_ENABLED(INFO)) {
|
||||||
LLOG(INFO, this) << "Created thread #" << workers_.size() - 1;
|
LLOG(INFO, this) << "Created thread #" << workers_.size() - 1;
|
||||||
|
|
|
@ -127,6 +127,8 @@ private:
|
||||||
// Stores all SSL_CTX objects.
|
// Stores all SSL_CTX objects.
|
||||||
std::vector<SSL_CTX *> all_ssl_ctx_;
|
std::vector<SSL_CTX *> all_ssl_ctx_;
|
||||||
OCSPUpdateContext ocsp_;
|
OCSPUpdateContext ocsp_;
|
||||||
|
// ev_loop for each worker
|
||||||
|
std::vector<struct ev_loop *> worker_loops_;
|
||||||
// Worker instances when multi threaded mode (-nN, N >= 2) is used.
|
// Worker instances when multi threaded mode (-nN, N >= 2) is used.
|
||||||
std::vector<std::unique_ptr<Worker>> workers_;
|
std::vector<std::unique_ptr<Worker>> workers_;
|
||||||
// Worker instance used when single threaded mode (-n1) is used.
|
// Worker instance used when single threaded mode (-n1) is used.
|
||||||
|
|
|
@ -104,7 +104,6 @@ Worker::Worker(struct ev_loop *loop, SSL_CTX *sv_ssl_ctx, SSL_CTX *cl_ssl_ctx,
|
||||||
Worker::~Worker() {
|
Worker::~Worker() {
|
||||||
ev_async_stop(loop_, &w_);
|
ev_async_stop(loop_, &w_);
|
||||||
ev_timer_stop(loop_, &mcpool_clear_timer_);
|
ev_timer_stop(loop_, &mcpool_clear_timer_);
|
||||||
ev_loop_destroy(loop_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Worker::schedule_clear_mcpool() {
|
void Worker::schedule_clear_mcpool() {
|
||||||
|
|
Loading…
Reference in New Issue