Skip to content

Commit

Permalink
refactor(client): Simplify getEndpointUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfr committed Dec 4, 2024
1 parent 0cc73fe commit 4697450
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/client/ua_client_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ findUserTokenPolicy(UA_Client *client, UA_EndpointDescription *endpoint);
* We fall back if connecting to an EndpointUrl fails. */
static UA_String
getEndpointUrl(UA_Client *client) {
if(client->endpoint.endpointUrl.length > 0) {
if(client->endpoint.endpointUrl.length > 0)
return client->endpoint.endpointUrl;
} else if(client->discoveryUrl.length > 0) {
if(client->discoveryUrl.length > 0)
return client->discoveryUrl;
} else {
return client->config.endpointUrl;
}
return client->config.endpointUrl;
}

/* If an EndpointUrl doesn't work (TCP connection fails), fall back to the
Expand Down

0 comments on commit 4697450

Please sign in to comment.