shrpx: Fix client mode does not work

This commit is contained in:
Tatsuhiro Tsujikawa 2013-02-09 17:45:57 +09:00
parent 18dc6384d4
commit ceba5539a1
1 changed files with 9 additions and 4 deletions

View File

@ -236,11 +236,16 @@ namespace {
int event_loop() int event_loop()
{ {
event_base *evbase = event_base_new(); event_base *evbase = event_base_new();
SSL_CTX *sv_ssl_ctx, *cl_ssl_ctx;
SSL_CTX *sv_ssl_ctx = get_config()->default_ssl_ctx; if(get_config()->client_mode) {
SSL_CTX *cl_ssl_ctx = (get_config()->client_mode || sv_ssl_ctx = 0;
get_config()->spdy_bridge)? cl_ssl_ctx = ssl::create_ssl_client_context();
} else {
sv_ssl_ctx = get_config()->default_ssl_ctx;
cl_ssl_ctx = get_config()->spdy_bridge ?
ssl::create_ssl_client_context() : 0; ssl::create_ssl_client_context() : 0;
}
ListenHandler *listener_handler = new ListenHandler(evbase, sv_ssl_ctx, ListenHandler *listener_handler = new ListenHandler(evbase, sv_ssl_ctx,
cl_ssl_ctx); cl_ssl_ctx);