From d0df213164104053277e73eefd801766ef4a5532 Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Wed, 14 Mar 2018 16:47:39 +0100 Subject: [PATCH] fix ssl initialisation bug --- http_server.c | 2 +- httpd.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/http_server.c b/http_server.c index 094865e..c8bf92f 100644 --- a/http_server.c +++ b/http_server.c @@ -20,7 +20,7 @@ void accept_request(void* client) //char *query_string = NULL; //LOG("SOCK IS %d\n", ((antd_client_t*)client)->sock); numchars = read_buf(client, buf, sizeof(buf)); - if(numchars < 0) + if(numchars <= 0) { unknow(client); goto end; diff --git a/httpd.c b/httpd.c index f14bf3c..badbb08 100644 --- a/httpd.c +++ b/httpd.c @@ -242,6 +242,7 @@ int main(int argc, char* argv[]) if(server_config.usessl == 1) { client->ssl = (void*)SSL_new(ctx); + if(!client->ssl) continue; SSL_set_fd((SSL*)client->ssl, client_sock); if (SSL_accept((SSL*)client->ssl) <= 0) {