Unverified Commit 380c0b02 authored by Dennis Jenkins's avatar Dennis Jenkins Committed by GitHub

Merge pull request #703 from hyperxor/fix_build_after_refactoring

Issue #700: fix build
parents ff527715 bf2aa8a8
......@@ -310,26 +310,27 @@ void Listener::handleNewConnection() {
struct sockaddr_in peer_addr;
int client_fd = acceptConnection(peer_addr);
#ifdef PISTACHE_USE_SSL
SSL *ssl = nullptr;
void *ssl = nullptr;
#ifdef PISTACHE_USE_SSL
if (this->useSSL_) {
ssl = SSL_new((SSL_CTX *)this->ssl_ctx_);
if (ssl == NULL) {
SSL* ssl_data = SSL_new((SSL_CTX *)this->ssl_ctx_);
if (ssl_data == nullptr) {
close(client_fd);
throw std::runtime_error("Cannot create SSL connection");
}
SSL_set_fd(ssl, client_fd);
SSL_set_accept_state(ssl);
SSL_set_fd(ssl_data, client_fd);
SSL_set_accept_state(ssl_data);
if (SSL_accept(ssl) <= 0) {
if (SSL_accept(ssl_data) <= 0) {
ERR_print_errors_fp(stderr);
SSL_free(ssl);
SSL_free(ssl_data);
close(client_fd);
return;
}
ssl = static_cast<void*>(ssl_data);
}
#endif /* PISTACHE_USE_SSL */
......
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