nghttpx: Fix server error with -n1 and --tls-ctx-per-worker

This commit is contained in:
Tatsuhiro Tsujikawa 2015-01-13 21:53:53 +09:00
parent 1e4f8f27fd
commit 5e8eb926f2
1 changed files with 9 additions and 7 deletions

View File

@ -542,17 +542,19 @@ int event_loop() {
} }
#endif // !NOTHREADS #endif // !NOTHREADS
if (get_config()->num_worker > 1) {
if (!get_config()->tls_ctx_per_worker) { if (!get_config()->tls_ctx_per_worker) {
conn_handler->create_ssl_context(); conn_handler->create_ssl_context();
} }
if (get_config()->num_worker > 1) {
conn_handler->create_worker_thread(get_config()->num_worker); conn_handler->create_worker_thread(get_config()->num_worker);
} else if (get_config()->downstream_proto == PROTO_HTTP2) { } else {
conn_handler->create_ssl_context();
if (get_config()->downstream_proto == PROTO_HTTP2) {
conn_handler->create_http2_session(); conn_handler->create_http2_session();
} else { } else {
conn_handler->create_http1_connect_blocker(); conn_handler->create_http1_connect_blocker();
} }
}
#ifndef NOTHREADS #ifndef NOTHREADS
rv = pthread_sigmask(SIG_UNBLOCK, &signals, nullptr); rv = pthread_sigmask(SIG_UNBLOCK, &signals, nullptr);