lru = lru64_get(XXH64(smp->data.str.str, smp->data.str.len, seed),
_51d_lru_tree, global._51degrees.data_file_path, 0);
if (lru && lru->domain) {
+ smp->flags |= SMP_F_CONST;
smp->data.str.str = lru->data;
smp->data.str.len = strlen(smp->data.str.str);
return 1;
return 0;
#endif
+ /* Duplicate the data and remove the "const" flag before device detection. */
+ if (!smp_dup(smp))
+ return 0;
+
smp->data.str.str[smp->data.str.len] = '\0';
/* Perform detection. */
i = 0;
temp = get_trash_chunk();
- chunk_reset(temp);
/* Loop through property names passed to the filter and fetch them from the dataset. */
while (args[i].data.str.str) {
fiftyoneDegreesFreeWorkset(ws);
#endif
- if (lru)
+ if (lru) {
+ smp->flags |= SMP_F_CONST;
lru64_commit(lru, strdup(smp->data.str.str), global._51degrees.data_file_path, 0, free);
+ }
return 1;
}