mirror of
https://github.com/lxsang/ant-http
synced 2024-12-27 09:18:22 +01:00
fix
This commit is contained in:
parent
44e67913b5
commit
181ee44a51
4
httpd.c
4
httpd.c
@ -52,7 +52,9 @@ void configure_context(SSL_CTX *ctx)
|
|||||||
SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_TICKET);
|
SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_TICKET);
|
||||||
SSL_CTX_set_session_id_context(ctx, (void *)&ssl_session_ctx_id, sizeof(ssl_session_ctx_id));
|
SSL_CTX_set_session_id_context(ctx, (void *)&ssl_session_ctx_id, sizeof(ssl_session_ctx_id));
|
||||||
/* Set the key and cert */
|
/* Set the key and cert */
|
||||||
if (SSL_CTX_use_certificate_file(ctx, server_config.sslcert, SSL_FILETYPE_PEM) <= 0) {
|
/* use the full chain bundle of certificate */
|
||||||
|
//if (SSL_CTX_use_certificate_file(ctx, server_config.sslcert, SSL_FILETYPE_PEM) <= 0) {
|
||||||
|
if (SSL_CTX_use_certificate_chain_file(ctx, server_config.sslcert) <= 0) {
|
||||||
ERR_print_errors_fp(stderr);
|
ERR_print_errors_fp(stderr);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
@ -87,10 +87,10 @@ int antd_send(void *src, const void* data, int len)
|
|||||||
#ifdef USE_OPENSSL
|
#ifdef USE_OPENSSL
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(ret <= 0)
|
/*if(ret <= 0)
|
||||||
{
|
{
|
||||||
antd_close(src);
|
antd_close(src);
|
||||||
}
|
}*/
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
int antd_recv(void *src, void* data, int len)
|
int antd_recv(void *src, void* data, int len)
|
||||||
@ -111,10 +111,10 @@ int antd_recv(void *src, void* data, int len)
|
|||||||
#ifdef USE_OPENSSL
|
#ifdef USE_OPENSSL
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(ret == 0)
|
/*if(ret == 0)
|
||||||
{
|
{
|
||||||
antd_close(src);
|
antd_close(src);
|
||||||
}
|
}*/
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
int antd_close(void* src)
|
int antd_close(void* src)
|
||||||
@ -136,6 +136,7 @@ int antd_close(void* src)
|
|||||||
server_config.connection--;
|
server_config.connection--;
|
||||||
LOG("Remaining connection %d\n", server_config.connection);
|
LOG("Remaining connection %d\n", server_config.connection);
|
||||||
free(src);
|
free(src);
|
||||||
|
src = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
int __ti(void* client,int data)
|
int __ti(void* client,int data)
|
||||||
|
Loading…
Reference in New Issue
Block a user