some warnings addressed
authorMarcel Poul <marcel.poul@cern.ch>
Sun, 26 Feb 2012 00:45:04 +0000 (00:45 +0000)
committerMarcel Poul <marcel.poul@cern.ch>
Sun, 26 Feb 2012 00:45:04 +0000 (00:45 +0000)
emi.canl.canl-c/examples/canl_sample_client.c
emi.canl.canl-c/src/canl_ssl.c

index 9027e3f..d3ae858 100644 (file)
@@ -4,6 +4,7 @@
 #include <string.h>
 
 #include <canl.h>
+#include <canl_ssl.h>
 
 #define BUF_LEN 1000
 
index 52c5dcd..b752d65 100644 (file)
@@ -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);