From b59288f88146b64ac5fda296675c523df11658b8 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 15 Jul 2017 13:49:30 +0200 Subject: vtls: refactor out essential information about the SSL backends There is information about the compiled-in SSL backends that is really no concern of any code other than the SSL backend itself, such as which function (if any) implements SHA-256 summing. And there is information that is really interesting to the user, such as the name, or the curl_sslbackend value. Let's factor out the latter into a publicly visible struct. This information will be used in the upcoming API to set the SSL backend globally. Signed-off-by: Johannes Schindelin --- lib/vtls/vtls.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/vtls/vtls.c') diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index ed43e1d46..b149d40cf 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -138,7 +138,7 @@ int Curl_ssl_backend(void) { #ifdef USE_SSL multissl_init(); - return Curl_ssl->id; + return Curl_ssl->info.id; #else return (int)CURLSSLBACKEND_NONE; #endif @@ -1099,8 +1099,7 @@ static void Curl_multissl_close(struct connectdata *conn, int sockindex) } static const struct Curl_ssl Curl_ssl_multi = { - "multi", /* name */ - CURLSSLBACKEND_NONE, + { CURLSSLBACKEND_NONE, "multi" }, /* info */ 0, /* have_ca_path */ 0, /* have_certinfo */ @@ -1182,7 +1181,7 @@ static int multissl_init(void) env = getenv("CURL_SSL_BACKEND"); if(env) for(i = 0; available_backends[i]; i++) - if(!strcmp(env, available_backends[i]->name)) { + if(!strcmp(env, available_backends[i]->info.name)) { Curl_ssl = available_backends[i]; return 0; } -- cgit v1.2.3