1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

global_init: ignore CURL_GLOBAL_SSL's absense

This bit is no longer used. It is not clear what it meant for users to
"init the TLS" in a world with different TLS backends and since the
introduction of multissl, libcurl didn't properly work if inited without
this bit set.

Not a single user responded to the call for users of it:
https://curl.haxx.se/mail/lib-2017-11/0072.html

Reported-by: Evgeny Grin
Assisted-by: Jay Satiro

Fixes #2089
Fixes #2083
Closes #2107
This commit is contained in:
Daniel Stenberg 2017-11-23 17:02:48 +01:00
parent 7f2a1df6f5
commit d661b0afb5
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
3 changed files with 9 additions and 10 deletions

View File

@ -62,6 +62,9 @@ Initialize everything possible. This sets all known bits except
\fBCURL_GLOBAL_ACK_EINTR\fP. \fBCURL_GLOBAL_ACK_EINTR\fP.
.IP CURL_GLOBAL_SSL .IP CURL_GLOBAL_SSL
(This flag's presence or absense serves no meaning since 7.57.0. The
description below is for older libcurl versions.)
Initialize SSL. Initialize SSL.
The implication here is that if this bit is not set, the initialization of the The implication here is that if this bit is not set, the initialization of the

View File

@ -2514,7 +2514,7 @@ typedef enum {
CURLCLOSEPOLICY_LAST /* last, never use this */ CURLCLOSEPOLICY_LAST /* last, never use this */
} curl_closepolicy; } curl_closepolicy;
#define CURL_GLOBAL_SSL (1<<0) #define CURL_GLOBAL_SSL (1<<0) /* no purpose since since 7.57.0 */
#define CURL_GLOBAL_WIN32 (1<<1) #define CURL_GLOBAL_WIN32 (1<<1)
#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
#define CURL_GLOBAL_NOTHING 0 #define CURL_GLOBAL_NOTHING 0

View File

@ -215,11 +215,10 @@ static CURLcode global_init(long flags, bool memoryfuncs)
#endif #endif
} }
if(flags & CURL_GLOBAL_SSL) if(!Curl_ssl_init()) {
if(!Curl_ssl_init()) { DEBUGF(fprintf(stderr, "Error: Curl_ssl_init failed\n"));
DEBUGF(fprintf(stderr, "Error: Curl_ssl_init failed\n")); return CURLE_FAILED_INIT;
return CURLE_FAILED_INIT; }
}
if(flags & CURL_GLOBAL_WIN32) if(flags & CURL_GLOBAL_WIN32)
if(win32_init()) { if(win32_init()) {
@ -319,10 +318,7 @@ void curl_global_cleanup(void)
return; return;
Curl_global_host_cache_dtor(); Curl_global_host_cache_dtor();
Curl_ssl_cleanup();
if(init_flags & CURL_GLOBAL_SSL)
Curl_ssl_cleanup();
Curl_resolver_global_cleanup(); Curl_resolver_global_cleanup();
if(init_flags & CURL_GLOBAL_WIN32) if(init_flags & CURL_GLOBAL_WIN32)