Add ndpi_domain_classify_finalize() function (#2084)
The "domain classify" data structure is immutable, since it uses "bitmap64". Allow to finalize it before starting to process packets (i.e. before calling `ndpi_domain_classify_contains()`) to avoid, in the data-path, all the memory allocations due to compression. Calling `ndpi_domain_classify_finalize()` is optional.
This commit is contained in:
@@ -6959,6 +6959,7 @@ int ndpi_enable_loaded_categories(struct ndpi_detection_module_struct *ndpi_str)
|
||||
}
|
||||
#else
|
||||
ndpi_domain_classify_free(ndpi_str->custom_categories.sc_hostnames);
|
||||
ndpi_domain_classify_finalize(ndpi_str->custom_categories.sc_hostnames_shadow);
|
||||
ndpi_str->custom_categories.sc_hostnames = ndpi_str->custom_categories.sc_hostnames_shadow;
|
||||
ndpi_str->custom_categories.sc_hostnames_shadow = ndpi_domain_classify_alloc();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user