From: Aki Tuomi Date: Fri, 25 Jul 2025 09:00:57 +0000 (+0300) Subject: auth: auth-cache - Drop auth_cache_parse_key() X-Git-Tag: 2.4.2~596 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34caed79b76a7b82a2a9c94cf35371bec6c2b826;p=thirdparty%2Fdovecot%2Fcore.git auth: auth-cache - Drop auth_cache_parse_key() It's only used by tests and can now just call auth_cache_parse_key_and_fields(). --- diff --git a/src/auth/auth-cache.c b/src/auth/auth-cache.c index 32959f5d0f..82cc0d526e 100644 --- a/src/auth/auth-cache.c +++ b/src/auth/auth-cache.c @@ -130,11 +130,6 @@ static int auth_cache_parse_key_exclude(pool_t pool, const char *query, return 0; } -char *auth_cache_parse_key(pool_t pool, const char *query) -{ - return auth_cache_parse_key_and_fields(pool, query, NULL, NULL); -} - char *auth_cache_parse_key_and_fields(pool_t pool, const char *query, const ARRAY_TYPE(const_string) *fields, const char *exclude_driver) diff --git a/src/auth/auth-cache.h b/src/auth/auth-cache.h index 9bdb918517..d63621b1a4 100644 --- a/src/auth/auth-cache.h +++ b/src/auth/auth-cache.h @@ -16,10 +16,8 @@ struct auth_cache_node { struct auth_cache; struct auth_request; -/* Parses all %x variables from query and compresses them into tab-separated - list, so it can be used as a cache key. */ -char *auth_cache_parse_key(pool_t pool, const char *query); -/* Same as auth_cache_parse_key(), but add also variables from "fields", +/* Parses all %variables from query and compresses them into tab-separated + list, so it can be used as a cache key. Adds also variables from "fields", except variables prefixed with ":" */ char *auth_cache_parse_key_and_fields(pool_t pool, const char *query, const ARRAY_TYPE(const_string) *fields, diff --git a/src/auth/test-auth-cache.c b/src/auth/test-auth-cache.c index b36d83ec02..f58c21f7af 100644 --- a/src/auth/test-auth-cache.c +++ b/src/auth/test-auth-cache.c @@ -93,8 +93,8 @@ static void test_auth_cache_parse_key(void) test_begin("auth cache parse key"); for (i = 0; i < N_ELEMENTS(tests); i++) { - cache_key = auth_cache_parse_key(pool_datastack_create(), - tests[i].in); + cache_key = auth_cache_parse_key_and_fields(pool_datastack_create(), + tests[i].in, NULL, NULL); test_assert_strcmp_idx(cache_key, tests[i].out, i); } @@ -119,8 +119,8 @@ static enum fatal_test_state test_cache_key_missing_variable(unsigned int i) if (i < N_ELEMENTS(tests_bad)) { test_expect_fatal_string(tests_bad[i].out); - (void)auth_cache_parse_key(pool_datastack_create(), - tests_bad[i].in); + (void)auth_cache_parse_key_and_fields(pool_datastack_create(), + tests_bad[i].in, NULL, NULL); return FATAL_TEST_FAILURE; }