From 5907302f33e8cece15577af9783994b0062edb70 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kou=C5=99il?= Date: Wed, 18 Jan 2012 19:07:28 +0000 Subject: [PATCH] Addressed some warnings --- emi.canl.canl-c/examples/canl_sample_server.c | 1 + emi.canl.canl-c/src/canl_err.c | 2 +- emi.canl.canl-c/src/canl_ssl.c | 7 +++---- emi.canl.canl-c/src/proxy/sslutils.h | 4 ++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/emi.canl.canl-c/examples/canl_sample_server.c b/emi.canl.canl-c/examples/canl_sample_server.c index 800e0ab..6048add 100644 --- a/emi.canl.canl-c/examples/canl_sample_server.c +++ b/emi.canl.canl-c/examples/canl_sample_server.c @@ -6,6 +6,7 @@ #include #include +#include #define BUF_LEN 1000 #define BACKLOG 10 diff --git a/emi.canl.canl-c/src/canl_err.c b/emi.canl.canl-c/src/canl_err.c index 97c0f50..8353da0 100644 --- a/emi.canl.canl-c/src/canl_err.c +++ b/emi.canl.canl-c/src/canl_err.c @@ -163,7 +163,7 @@ static void get_error_string(glb_ctx *cc, char *code_str) code_str[ERR_CODE_LEN - 1] = '\0'; } case netdb_error: - new_str = hstrerror(cc->err_code); + new_str = (char *) hstrerror(cc->err_code); if (new_str) { strncpy(code_str, new_str, ERR_CODE_LEN); diff --git a/emi.canl.canl-c/src/canl_ssl.c b/emi.canl.canl-c/src/canl_ssl.c index fb93e4d..a13feb0 100644 --- a/emi.canl.canl-c/src/canl_ssl.c +++ b/emi.canl.canl-c/src/canl_ssl.c @@ -261,10 +261,8 @@ static int check_hostname_cert(glb_ctx *cc, io_handler *io, X509_EXTENSION *ext = NULL; int i = 0; GENERAL_NAMES *ialt = NULL; - unsigned char *pBuffer = NULL; + char *pBuffer = NULL; int correspond = 0; - struct sockaddr *addr = NULL; - socklen_t addrlen = 0; X509_NAME *sn = NULL; /*if extensions are present, hostname has to correspond @@ -732,11 +730,12 @@ ssl_close(glb_ctx *cc, io_handler *io, void *auth_ctx) /* check the shutdown state*/ ret = SSL_get_shutdown(ssl); - if (ret & SSL_SENT_SHUTDOWN) + if (ret & SSL_SENT_SHUTDOWN) { if (ret & SSL_RECEIVED_SHUTDOWN) return 1; else return 0; + } /* TODO check the proper states, maybe also call SSL_shutdown if (ret & SSL_RECEIVED_SHUTDOWN) { return 0; diff --git a/emi.canl.canl-c/src/proxy/sslutils.h b/emi.canl.canl-c/src/proxy/sslutils.h index 0e79a86..3a5725c 100644 --- a/emi.canl.canl-c/src/proxy/sslutils.h +++ b/emi.canl.canl-c/src/proxy/sslutils.h @@ -530,6 +530,10 @@ STACK_OF(X509) *load_chain(BIO *in, char*); int my_txt2nid(char *name); +int +hex2num(char c); + + EXTERN_C_END #endif /* _SSLUTILS_H */ -- 1.8.2.3