diff --git a/src/server/run.c b/src/server/run.c index 03a5639..52b0d65 100644 --- a/src/server/run.c +++ b/src/server/run.c @@ -60,14 +60,14 @@ serverRun(Server this) } } - /** - * handle accept SSL - */ - if (0 != ((this->fds)[1].revents & POLLIN)) { - if (-1 == serverHandleAccept(this, 1)) { - events--; - } - } + // /** + // * handle accept SSL + // */ + // if (0 != ((this->fds)[1].revents & POLLIN)) { + // if (-1 == serverHandleAccept(this, 1)) { + // events--; + // } + // } for (i=2; i < this->nfds; i++) { /** diff --git a/src/server/server.c b/src/server/server.c index be73f61..3bd942c 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -74,31 +74,32 @@ serverCtor(void * _this, va_list * params) flags = fcntl(this->sock->handle, F_GETFL, 0); fcntl(this->sock->handle, F_SETFL, flags | O_NONBLOCK); - this->sockSSL = new(Sock, this->logger, port+1); - flags = fcntl(this->sockSSL->handle, F_GETFL, 0); - fcntl(this->sockSSL->handle, F_SETFL, flags | O_NONBLOCK); - - SSL_library_init(); - SSL_load_error_strings(); - this->ctx = SSL_CTX_new(SSLv23_server_method()); - SSL_CTX_use_certificate_file( - this->ctx, - "./certs/server.crt", - SSL_FILETYPE_PEM); - - SSL_CTX_use_RSAPrivateKey_file( - this->ctx, - "./certs/server.key", - SSL_FILETYPE_PEM); + // this->sockSSL = new(Sock, this->logger, port+1); + // flags = fcntl(this->sockSSL->handle, F_GETFL, 0); + // fcntl(this->sockSSL->handle, F_SETFL, flags | O_NONBLOCK); + + // SSL_library_init(); + // SSL_load_error_strings(); + // this->ctx = SSL_CTX_new(SSLv23_server_method()); + // SSL_CTX_use_certificate_file( + // this->ctx, + // "./certs/server.crt", + // SSL_FILETYPE_PEM); + + // SSL_CTX_use_RSAPrivateKey_file( + // this->ctx, + // "./certs/server.key", + // SSL_FILETYPE_PEM); socketListen(this->sock, backlog); - socketListen(this->sockSSL, backlog); + // socketListen(this->sockSSL, backlog); (this->fds)[0].fd = this->sock->handle; (this->fds)[0].events = POLLIN; - (this->fds)[1].fd = this->sockSSL->handle; - (this->fds)[1].events = POLLIN; - this->nfds = 2; + // (this->fds)[1].fd = this->sockSSL->handle; + // (this->fds)[1].events = POLLIN; + // this->nfds = 2; + this->nfds = 1; return 0; } @@ -121,10 +122,10 @@ serverDtor(void * _this) MEM_FREE(this->conns); delete(this->sock); - delete(this->sockSSL); + // delete(this->sockSSL); - SSL_CTX_free(this->ctx); - ERR_free_strings(); + // SSL_CTX_free(this->ctx); + // ERR_free_strings(); } INIT_IFACE(Class, serverCtor, serverDtor, NULL);