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

open ssl still leak memory

This commit is contained in:
lxsang 2018-10-09 12:15:48 +02:00
parent d91370548d
commit a3509ca6aa
3 changed files with 18 additions and 2 deletions

View File

@ -203,6 +203,7 @@ void *accept_request(void *data)
return task; return task;
default: default:
LOG("Error performing SSL handshake %d %d %lu\n", stat, ret, ERR_get_error()); LOG("Error performing SSL handshake %d %d %lu\n", stat, ret, ERR_get_error());
server_config.connection++;
ERR_print_errors_fp(stderr); ERR_print_errors_fp(stderr);
return task; return task;
} }
@ -339,7 +340,7 @@ void *resolve_request(void *data)
if (h) if (h)
{ {
//sprintf(path,"/%s%s",h,url); //sprintf(path,"/%s%s",h,url);
LOG("WARNING::::Access octetstream via handler %s\n", h); LOG("WARNING::::Access octetstream via handle %s\n", h);
//if(execute_plugin(client,buf,method,rq) < 0) //if(execute_plugin(client,buf,method,rq) < 0)
// cannot_execute(client); // cannot_execute(client);
free(task); free(task);
@ -941,7 +942,7 @@ void *decode_multi_part_request_data(void *data)
} }
else else
{ {
LOG("Cannot wirte file to :%s\n", file_path); LOG("Cannot write file to :%s\n", file_path);
} }
free(file_path); free(file_path);
free(part_file); free(part_file);

View File

@ -85,7 +85,15 @@ void stop_serve(int dummy) {
unload_all_plugin(); unload_all_plugin();
destroy_config(); destroy_config();
#ifdef USE_OPENSSL #ifdef USE_OPENSSL
FIPS_mode_set(0);
SSL_CTX_free(ctx); SSL_CTX_free(ctx);
FIPS_mode_set(0);
CONF_modules_unload(1);
EVP_cleanup();
ENGINE_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_remove_state(0);
ERR_free_strings();
#endif #endif
close(server_sock); close(server_sock);
sigprocmask(SIG_UNBLOCK, &mask, NULL); sigprocmask(SIG_UNBLOCK, &mask, NULL);

View File

@ -234,6 +234,13 @@ int antd_close(void* src)
SSL_set_shutdown((SSL*) source->ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN); SSL_set_shutdown((SSL*) source->ssl, SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
//printf("SSL:Free ssl\n"); //printf("SSL:Free ssl\n");
SSL_free((SSL*) source->ssl); SSL_free((SSL*) source->ssl);
//EVP_cleanup();
//ENGINE_cleanup();
CRYPTO_cleanup_all_ex_data();
ERR_remove_state(0);
ERR_free_strings();
source->ssl = NULL;
//LOG("Freeing SSL\n"); //LOG("Freeing SSL\n");
} }
#endif #endif