From 4c4a964423cc59bcdf21c879d6f0b8a00afe63c7 Mon Sep 17 00:00:00 2001 From: Marcel Poul Date: Sun, 26 Feb 2012 00:45:04 +0000 Subject: [PATCH] some warnings addressed --- emi.canl.canl-c/examples/canl_sample_client.c | 1 + emi.canl.canl-c/src/canl_ssl.c | 11 ----------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/emi.canl.canl-c/examples/canl_sample_client.c b/emi.canl.canl-c/examples/canl_sample_client.c index 9027e3f..d3ae858 100644 --- a/emi.canl.canl-c/examples/canl_sample_client.c +++ b/emi.canl.canl-c/examples/canl_sample_client.c @@ -4,6 +4,7 @@ #include #include +#include #define BUF_LEN 1000 diff --git a/emi.canl.canl-c/src/canl_ssl.c b/emi.canl.canl-c/src/canl_ssl.c index 52c5dcd..b752d65 100644 --- a/emi.canl.canl-c/src/canl_ssl.c +++ b/emi.canl.canl-c/src/canl_ssl.c @@ -294,7 +294,6 @@ static canl_err_code ssl_connect(glb_ctx *cc, io_handler *io, void *auth_ctx, struct timeval *timeout, const char * host) { - SSL_CTX *ctx; SSL *ssl = (SSL *) auth_ctx; int err = 0, flags; @@ -308,8 +307,6 @@ ssl_connect(glb_ctx *cc, io_handler *io, void *auth_ctx, if (ssl == NULL) return set_error(cc, EINVAL, POSIX_ERROR, "SSL not initialized"); - ctx = SSL_get_SSL_CTX(ssl); - flags = fcntl(io->sock, F_GETFL, 0); (void)fcntl(io->sock, F_SETFL, flags | O_NONBLOCK); @@ -411,7 +408,6 @@ end: static canl_err_code ssl_accept(glb_ctx *cc, io_handler *io, void *auth_ctx, struct timeval *timeout) { - SSL_CTX *ctx = NULL; SSL *ssl = (SSL *) auth_ctx; int err = 0, flags; @@ -425,8 +421,6 @@ ssl_accept(glb_ctx *cc, io_handler *io, void *auth_ctx, struct timeval *timeout) if (auth_ctx == NULL) return set_error(cc, EINVAL, POSIX_ERROR, "SSL not initialized"); - ctx = SSL_get_SSL_CTX(ssl); - flags = fcntl(io->sock, F_GETFL, 0); (void)fcntl(io->sock, F_SETFL, flags | O_NONBLOCK); @@ -562,7 +556,6 @@ static int do_ssl_accept(glb_ctx *cc, io_handler *io, int ret = -1, ret2 = -1; unsigned long ssl_err = 0; int err = 0; - canl_err_origin e_orig = UNKNOWN_ERROR; long errorcode = 0; int expected = 0; int locl_timeout = -1; @@ -581,7 +574,6 @@ static int do_ssl_accept(glb_ctx *cc, io_handler *io, ret2 = SSL_accept(ssl); if (ret2 < 0) { ssl_err = ERR_peek_error(); - e_orig = SSL_ERROR; } expected = errorcode = SSL_get_error(ssl, ret2); } @@ -785,7 +777,6 @@ ssl_read(glb_ctx *cc, io_handler *io, void *auth_ctx, static canl_err_code ssl_close(glb_ctx *cc, io_handler *io, void *auth_ctx) { - SSL_CTX *ctx; int timeout = DESTROY_TIMEOUT; time_t starttime, curtime; int expected = 0, error = 0, ret = 0, ret2 = 0; @@ -801,8 +792,6 @@ ssl_close(glb_ctx *cc, io_handler *io, void *auth_ctx) if (ssl == NULL) return set_error(cc, EINVAL, POSIX_ERROR, "SSL not initialized"); - ctx = SSL_get_SSL_CTX(ssl); - fd = BIO_get_fd(SSL_get_rbio(ssl), NULL); curtime = starttime = time(NULL); -- 1.8.2.3