From 5e8eb926f276f63eba078837d850e9231eccdce7 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 13 Jan 2015 21:53:53 +0900 Subject: [PATCH] nghttpx: Fix server error with -n1 and --tls-ctx-per-worker --- src/shrpx.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/shrpx.cc b/src/shrpx.cc index 0d183d66..9dcb8f9f 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -542,16 +542,18 @@ int event_loop() { } #endif // !NOTHREADS - if (!get_config()->tls_ctx_per_worker) { - conn_handler->create_ssl_context(); - } - if (get_config()->num_worker > 1) { + if (!get_config()->tls_ctx_per_worker) { + conn_handler->create_ssl_context(); + } conn_handler->create_worker_thread(get_config()->num_worker); - } else if (get_config()->downstream_proto == PROTO_HTTP2) { - conn_handler->create_http2_session(); } else { - conn_handler->create_http1_connect_blocker(); + conn_handler->create_ssl_context(); + if (get_config()->downstream_proto == PROTO_HTTP2) { + conn_handler->create_http2_session(); + } else { + conn_handler->create_http1_connect_blocker(); + } } #ifndef NOTHREADS