mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-25 22:18:07 +00:00
Merge "astdb: Improve prefix searches in astdb" into 13
This commit is contained in:
@@ -336,14 +336,14 @@ static void sorcery_astdb_retrieve_prefix(const struct ast_sorcery *sorcery, voi
|
||||
const char *family_prefix = data;
|
||||
size_t family_len = strlen(family_prefix) + strlen(type) + 1; /* +1 for slash delimiter */
|
||||
char family[family_len + 1];
|
||||
char tree[prefix_len + sizeof("%")];
|
||||
char tree[prefix_len + 1];
|
||||
RAII_VAR(struct ast_db_entry *, entries, NULL, ast_db_freetree);
|
||||
struct ast_db_entry *entry;
|
||||
|
||||
snprintf(tree, sizeof(tree), "%.*s%%", (int) prefix_len, prefix);
|
||||
snprintf(tree, sizeof(tree), "%.*s", (int) prefix_len, prefix);
|
||||
snprintf(family, sizeof(family), "%s/%s", family_prefix, type);
|
||||
|
||||
if (!(entries = ast_db_gettree(family, tree))) {
|
||||
if (!(entries = ast_db_gettree_by_prefix(family, tree))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user