1
0
mirror of https://github.com/lxsang/ant-http synced 2024-07-03 13:39:46 +02:00

fix ssl initialisation bug

This commit is contained in:
Xuan Sang LE 2018-03-14 16:47:39 +01:00
parent dab7e28903
commit d0df213164
2 changed files with 2 additions and 1 deletions

View File

@ -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;

View File

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