From af4b1f409ef36a483d472e8647cf1a6b353f25dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kou=C5=99il?= Date: Tue, 17 Jan 2012 20:12:20 +0000 Subject: [PATCH] Added ssl_finish() to free the global context --- emi.canl.canl-c/src/canl_locl.h | 6 +++--- emi.canl.canl-c/src/canl_ssl.c | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/emi.canl.canl-c/src/canl_locl.h b/emi.canl.canl-c/src/canl_locl.h index 84c31f0..66504cf 100644 --- a/emi.canl.canl-c/src/canl_locl.h +++ b/emi.canl.canl-c/src/canl_locl.h @@ -104,6 +104,9 @@ typedef struct canl_mech { canl_err_code (*initialize) (void **); + canl_err_code (*finish) + (void *); + canl_err_code (*client_init) (glb_ctx *, void **); @@ -113,9 +116,6 @@ typedef struct canl_mech { canl_err_code (*free_ctx) (glb_ctx *, void *); - canl_err_code (*free_global_ctx) /* XXX: ???? */ - (glb_ctx *, void *); - canl_err_code (*connect) (glb_ctx *, void *, io_handler *, struct timeval *, const char *); diff --git a/emi.canl.canl-c/src/canl_ssl.c b/emi.canl.canl-c/src/canl_ssl.c index 0c6be1e..9e48457 100644 --- a/emi.canl.canl-c/src/canl_ssl.c +++ b/emi.canl.canl-c/src/canl_ssl.c @@ -756,6 +756,13 @@ ssl_free(glb_ctx *cc, void *ctx) return 0; } +int +ssl_finish(glb_ctx *cc, void *ctx) +{ + SSL_CTX_free(ctx); + return 0; +} + canl_err_code canl_ctx_set_ssl_cred(canl_ctx cc, char *cert, char *key, canl_password_callback cb, void *userdata) -- 1.8.2.3