Skip to content

Commit

Permalink
curl_global_sslset(): id == -1 is not necessarily an error
Browse files Browse the repository at this point in the history
It is allowed to call that function with id set to -1, specifying the
backend by the name instead. We should imitate what is done further down
in that function to allow for that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Dec 6, 2018
1 parent 4db1874 commit 231a328
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/vtls/vtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,9 @@ CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
*avail = (const curl_ssl_backend **)&available_backends;

if(Curl_ssl != &Curl_ssl_multi)
return id == Curl_ssl->info.id ? CURLSSLSET_OK : CURLSSLSET_TOO_LATE;
return id == Curl_ssl->info.id ||
(name && strcasecompare(name, Curl_ssl->info.name)) ?
CURLSSLSET_OK : CURLSSLSET_TOO_LATE;

for(i = 0; available_backends[i]; i++) {
if(available_backends[i]->info.id == id ||
Expand Down

0 comments on commit 231a328

Please sign in to comment.