Tue, 27 Dec 2016 17:54:00 +0100
adds blockingio config
--- a/src/server/daemon/config.c Tue Dec 27 17:19:00 2016 +0100 +++ b/src/server/daemon/config.c Tue Dec 27 17:54:00 2016 +0100 @@ -575,6 +575,13 @@ obj->directives, sstr("Threadpool"))); + sstr_t blockingio = cfg_directivelist_get_str( + obj->directives, + sstr("BlockingIO")); + if(blockingio.ptr) { + lc.blockingio = util_getboolean_s(blockingio, WS_FALSE); + } + sstr_t ssl = cfg_directivelist_get_str(obj->directives, S("SSL")); if(util_getboolean_s(ssl, WS_FALSE)) { sstr_t cert = cfg_directivelist_get_str(obj->directives, S("Cert"));
--- a/src/server/daemon/httplistener.c Tue Dec 27 17:19:00 2016 +0100 +++ b/src/server/daemon/httplistener.c Tue Dec 27 17:54:00 2016 +0100 @@ -153,8 +153,11 @@ if(listener->threadpool == NULL) { listener->threadpool = get_default_threadpool(); } - //listener->session_handler = create_basic_session_handler(); - listener->session_handler = create_event_session_handler(); + if(conf->blockingio) { + listener->session_handler = create_basic_session_handler(); + } else { + listener->session_handler = create_event_session_handler(); + } listener->nacceptors = conf->nacceptors; listener->port = conf->port; listener->ref = 1; @@ -401,7 +404,10 @@ if(ls->ssl) { SSL *ssl = SSL_new(ls->ssl->sslctx); SSL_set_fd(ssl, clientfd); - if(SSL_accept(ssl) <= 0) { + int ssl_ar = SSL_accept(ssl); + if(ssl_ar <= 0) { + int error = SSL_get_error(ssl, ssl_ar); + log_ereport(LOG_INFORM, "SSL accept error: %d", error); free(conn); conn = NULL; } else {