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) {