Commit d1bc3c89 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Code cleanup

parent 01503120
...@@ -235,23 +235,22 @@ void drop_privileges() ...@@ -235,23 +235,22 @@ void drop_privileges()
namespace { namespace {
int event_loop() int event_loop()
{ {
event_base *evbase = event_base_new(); auto evbase = event_base_new();
SSL_CTX *sv_ssl_ctx, *cl_ssl_ctx; SSL_CTX *sv_ssl_ctx, *cl_ssl_ctx;
if(get_config()->client_mode) { if(get_config()->client_mode) {
sv_ssl_ctx = 0; sv_ssl_ctx = nullptr;
cl_ssl_ctx = get_config()->downstream_no_tls ? cl_ssl_ctx = get_config()->downstream_no_tls ?
0 : ssl::create_ssl_client_context(); nullptr : ssl::create_ssl_client_context();
} else { } else {
sv_ssl_ctx = get_config()->upstream_no_tls ? sv_ssl_ctx = get_config()->upstream_no_tls ?
0 : get_config()->default_ssl_ctx; nullptr : get_config()->default_ssl_ctx;
cl_ssl_ctx = get_config()->spdy_bridge && cl_ssl_ctx = get_config()->spdy_bridge &&
!get_config()->downstream_no_tls ? !get_config()->downstream_no_tls ?
ssl::create_ssl_client_context() : 0; ssl::create_ssl_client_context() : nullptr;
} }
ListenHandler *listener_handler = new ListenHandler(evbase, sv_ssl_ctx, auto listener_handler = new ListenHandler(evbase, sv_ssl_ctx, cl_ssl_ctx);
cl_ssl_ctx);
if(get_config()->daemon) { if(get_config()->daemon) {
if(daemon(0, 0) == -1) { if(daemon(0, 0) == -1) {
LOG(FATAL) << "Failed to daemonize: " << strerror(errno); LOG(FATAL) << "Failed to daemonize: " << strerror(errno);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment