From: Daniel KouĊ™il Date: Tue, 17 Jan 2012 20:10:00 +0000 (+0000) Subject: ssl_init() moved among the other ssl calls X-Git-Tag: emi-canl-c_R_1_0_0_0~55 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=887438ad6fccd7fe498afc72e29e136b7b020811;p=jra1mw.git ssl_init() moved among the other ssl calls --- diff --git a/emi.canl.canl-c/src/canl.c b/emi.canl.canl-c/src/canl.c index e831b32..8fbad61 100644 --- a/emi.canl.canl-c/src/canl.c +++ b/emi.canl.canl-c/src/canl.c @@ -4,7 +4,6 @@ static void io_destroy(glb_ctx *cc, io_handler *io); static int init_io_content(glb_ctx *cc, io_handler *io); static int try_connect(glb_ctx *glb_cc, io_handler *io_cc, char *addr, int addrtype, int port, struct timeval *timeout); -static void ssl_init(); canl_ctx canl_create_ctx() { @@ -20,12 +19,6 @@ canl_ctx canl_create_ctx() return ctx; } -static void ssl_init() -{ - SSL_library_init(); - SSL_load_error_strings(); -} - void canl_free_ctx(canl_ctx cc) { glb_ctx *ctx = (glb_ctx*) cc; diff --git a/emi.canl.canl-c/src/canl_locl.h b/emi.canl.canl-c/src/canl_locl.h index c540a6b..d96a463 100644 --- a/emi.canl.canl-c/src/canl_locl.h +++ b/emi.canl.canl-c/src/canl_locl.h @@ -107,5 +107,6 @@ int ssl_read(glb_ctx *cc, io_handler *io, void *buffer, size_t size, int ssl_write(glb_ctx *cc, io_handler *io, void *buffer, size_t size, struct timeval *tout); int ssl_close(glb_ctx *cc, io_handler *io); +int ssl_init(); #endif diff --git a/emi.canl.canl-c/src/canl_ssl.c b/emi.canl.canl-c/src/canl_ssl.c index 16d30f3..7253306 100644 --- a/emi.canl.canl-c/src/canl_ssl.c +++ b/emi.canl.canl-c/src/canl_ssl.c @@ -10,6 +10,14 @@ static int check_hostname_cert(glb_ctx *cc, io_handler *io, const char *host); #ifdef DEBUG static void dbg_print_ssl_error(int errorcode); #endif + +int ssl_init() +{ + SSL_library_init(); + SSL_load_error_strings(); + return 0; +} + int ssl_server_init(glb_ctx *cc) { int err = 0;