cmake: fix unity builds for more build combinations

By using unique static function/variable names in source files
implementing these interfaces.

- OpenLDAP combined with any SSH backend.

- MultiSSL with mbedTLS, OpenSSL, wolfSSL, SecureTransport.

Closes #12027
This commit is contained in:
Viktor Szakats 2023-10-03 21:18:01 +00:00
parent 3fd80c7b59
commit fd328fcaf1
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
5 changed files with 74 additions and 67 deletions

View file

@ -199,11 +199,11 @@ struct ldapreqinfo {
};
/*
* state()
* oldap_state()
*
* This is the ONLY way to change LDAP state!
*/
static void state(struct Curl_easy *data, ldapstate newstate)
static void oldap_state(struct Curl_easy *data, ldapstate newstate)
{
struct ldapconninfo *ldapc = data->conn->proto.ldapc;
@ -444,7 +444,7 @@ static CURLcode oldap_perform_bind(struct Curl_easy *data, ldapstate newstate)
rc = ldap_sasl_bind(li->ld, binddn, LDAP_SASL_SIMPLE, &passwd,
NULL, NULL, &li->msgid);
if(rc == LDAP_SUCCESS)
state(data, newstate);
oldap_state(data, newstate);
else
result = oldap_map_error(rc,
data->state.aptr.user?
@ -467,7 +467,7 @@ static CURLcode oldap_perform_mechs(struct Curl_easy *data)
(char **) supportedSASLMechanisms, 0,
NULL, NULL, NULL, 0, &li->msgid);
if(rc == LDAP_SUCCESS)
state(data, OLDAP_MECHS);
oldap_state(data, OLDAP_MECHS);
else
result = oldap_map_error(rc, CURLE_LOGIN_DENIED);
return result;
@ -480,7 +480,7 @@ static CURLcode oldap_perform_sasl(struct Curl_easy *data)
struct ldapconninfo *li = data->conn->proto.ldapc;
CURLcode result = Curl_sasl_start(&li->sasl, data, TRUE, &progress);
state(data, OLDAP_SASL);
oldap_state(data, OLDAP_SASL);
if(!result && progress != SASL_INPROGRESS)
result = CURLE_LOGIN_DENIED;
return result;
@ -503,7 +503,7 @@ static CURLcode oldap_ssl_connect(struct Curl_easy *data, ldapstate newstate)
result = Curl_conn_connect(data, FIRSTSOCKET, FALSE, &ssldone);
if(!result) {
state(data, newstate);
oldap_state(data, newstate);
if(ssldone) {
Sockbuf *sb;
@ -527,7 +527,7 @@ static CURLcode oldap_perform_starttls(struct Curl_easy *data)
int rc = ldap_start_tls(li->ld, NULL, NULL, &li->msgid);
if(rc == LDAP_SUCCESS)
state(data, OLDAP_STARTTLS);
oldap_state(data, OLDAP_STARTTLS);
else
result = oldap_map_error(rc, CURLE_USE_SSL_FAILED);
return result;
@ -682,7 +682,7 @@ static CURLcode oldap_state_sasl_resp(struct Curl_easy *data,
else {
result = Curl_sasl_continue(&li->sasl, data, code, &progress);
if(!result && progress != SASL_INPROGRESS)
state(data, OLDAP_STOP);
oldap_state(data, OLDAP_STOP);
}
if(li->servercred)
@ -710,7 +710,7 @@ static CURLcode oldap_state_bind_resp(struct Curl_easy *data, LDAPMessage *msg,
result = oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND);
}
else
state(data, OLDAP_STOP);
oldap_state(data, OLDAP_STOP);
if(bv)
ber_bvfree(bv);
@ -804,7 +804,8 @@ static CURLcode oldap_connecting(struct Curl_easy *data, bool *done)
else if(data->state.aptr.user)
result = oldap_perform_bind(data, OLDAP_BIND);
else {
state(data, OLDAP_STOP); /* Version 3 supported: no bind required */
/* Version 3 supported: no bind required */
oldap_state(data, OLDAP_STOP);
result = CURLE_OK;
}
}