[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 91/256: version: if built with more than one SSL ba
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 91/256: version: if built with more than one SSL backend, report all of them |
Date: |
Fri, 06 Oct 2017 19:43:02 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 81d318fa95af55d53280e6efce263f227c201d68
Author: Johannes Schindelin <address@hidden>
AuthorDate: Fri Aug 18 13:01:38 2017 +0200
version: if built with more than one SSL backend, report all of them
To discern the active one from the inactive ones, put the latter into
parentheses.
Signed-off-by: Johannes Schindelin <address@hidden>
---
lib/vtls/vtls.c | 51 ++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 44 insertions(+), 7 deletions(-)
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
index 5d125141f..26de25e36 100644
--- a/lib/vtls/vtls.c
+++ b/lib/vtls/vtls.c
@@ -596,9 +596,15 @@ CURLcode Curl_ssl_initsessions(struct Curl_easy *data,
size_t amount)
return CURLE_OK;
}
+static size_t Curl_multissl_version(char *buffer, size_t size);
+
size_t Curl_ssl_version(char *buffer, size_t size)
{
+#ifdef CURL_WITH_MULTI_SSL
+ return Curl_multissl_version(buffer, size);
+#else
return Curl_ssl->version(buffer, size);
+#endif
}
/*
@@ -1061,13 +1067,6 @@ static int Curl_multissl_init(void)
return Curl_ssl->init();
}
-static size_t Curl_multissl_version(char *buffer, size_t size)
-{
- if(multissl_init(NULL))
- return 0;
- return Curl_ssl->version(buffer, size);
-}
-
static CURLcode Curl_multissl_connect(struct connectdata *conn, int sockindex)
{
if(multissl_init(NULL))
@@ -1167,6 +1166,44 @@ static const struct Curl_ssl *available_backends[] = {
NULL
};
+static size_t Curl_multissl_version(char *buffer, size_t size)
+{
+ static const struct Curl_ssl *selected;
+ static char backends[200];
+ static size_t total;
+ const struct Curl_ssl *current;
+
+ current = Curl_ssl == &Curl_ssl_multi ? available_backends[0] : Curl_ssl;
+
+ if(current != selected) {
+ char *p = backends;
+ int i;
+
+ selected = current;
+
+ for(i = 0; available_backends[i]; i++) {
+ if(i)
+ *(p++) = ' ';
+ if(selected != available_backends[i])
+ *(p++) = '(';
+ p += available_backends[i]->version(p, backends + sizeof(backends) - p);
+ if(selected != available_backends[i])
+ *(p++) = ')';
+ }
+ *p = '\0';
+ total = p - backends;
+ }
+
+ if(size < total)
+ memcpy(buffer, backends, total + 1);
+ else {
+ memcpy(buffer, backends, size - 1);
+ buffer[size - 1] = '\0';
+ }
+
+ return total;
+}
+
static int multissl_init(const struct Curl_ssl *backend)
{
const char *env;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 41/256: curl/system.h: fix build for hppa, (continued)
- [GNUnet-SVN] [gnurl] 41/256: curl/system.h: fix build for hppa, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 38/256: tests: Make sure libtests call curl_global_cleanup(), gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 53/256: imap: use defined names for response codes, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 33/256: KNOWN_BUGS: HTTP test server 'connection-monitor' problems, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 58/256: system.h: include sys/poll.h for AIX, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 48/256: config-dos: add missing defines, SIZEOF_* and two others, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 55/256: fuzz/Makefile.am: remove curlbuild.h leftovers, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 82/256: curl_ntlm_core: don't complain but #include OpenSSL header if needed, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 63/256: vtls: make sure all _data_pending() functions return bool, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 62/256: vtls: make sure all _cleanup() functions return void, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 91/256: version: if built with more than one SSL backend, report all of them,
gnunet <=
- [GNUnet-SVN] [gnurl] 88/256: docs/examples: demonstrate how to select SSL backends, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 61/256: vtls: use consistent signature for _random() implementations, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 92/256: vtls: use Curl_ssl_multi pseudo backend only when needed, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 83/256: vtls: fold the backend ID into the Curl_ssl structure, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 68/256: vtls: move md5sum into the Curl_ssl struct, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 45/256: tool_main: turn off MinGW CRT's globbing, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 25/256: system.h: remove all CURL_SIZEOF_* defines, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 96/256: asyn-thread: Improved cleanup after OOM situations, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 42/256: cmake: enable picky compiler options with clang and gcc, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 76/256: vtls: move SSL backends' private constants out of their header files, gnunet, 2017/10/06