From f3648fefe040152bb1676d651ebf7d836cb8ac9e Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Thu, 19 Feb 2026 00:01:18 +0100 Subject: Refactor: reduce duplication and tighten helpers - Remove redundant applicationUri log in print_application_description - Use UA_SECURITY_POLICY_NONE_URI macro instead of hardcoded string - Extract _s_register_with_lds / _s_deregister_from_lds helpers - Rename signal handler param 'sign' to 'sig' for consistency - Add INT_MIN/INT_MAX bounds check to config_require_int - Extract shared test helpers into tests/test_helpers.sh --- src/common.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/common.c') diff --git a/src/common.c b/src/common.c index 234f925..8f141d7 100644 --- a/src/common.c +++ b/src/common.c @@ -365,10 +365,6 @@ print_application_description (const UA_ApplicationDescription *description, UA_LOG_INFO (UA_Log_Stdout, UA_LOGCATEGORY_APPLICATION, " Name: %.*s", (int)description->applicationName.text.length, description->applicationName.text.data); - UA_LOG_INFO (UA_Log_Stdout, UA_LOGCATEGORY_APPLICATION, - " Application URI: %.*s", - (int)description->applicationUri.length, - description->applicationUri.data); UA_LOG_INFO (UA_Log_Stdout, UA_LOGCATEGORY_APPLICATION, " Product URI: %.*s", (int)description->productUri.length, description->productUri.data); @@ -507,8 +503,7 @@ create_unsecure_client_config (UA_ClientConfig *cc, cc->securityMode = UA_MESSAGESECURITYMODE_NONE; UA_String_clear (&cc->securityPolicyUri); - cc->securityPolicyUri = UA_String_fromChars ( - "http://opcfoundation.org/UA/SecurityPolicy#None"); + UA_String_copy (&UA_SECURITY_POLICY_NONE_URI, &cc->securityPolicyUri); if (auth && auth->mode == AUTH_USER) UA_ClientConfig_setAuthenticationUsername (cc, auth->user.username, -- cgit v1.2.3