Use shared_ptrs for DNS_Mapping objects

This commit is contained in:
Tim Wojtulewicz 2022-03-28 14:59:48 -07:00
parent b531ec97ef
commit c4cac72fd7
4 changed files with 32 additions and 36 deletions

View file

@ -11,6 +11,9 @@
namespace zeek::detail
{
class DNS_Mapping;
using DNS_MappingPtr = std::shared_ptr<DNS_Mapping>;
class DNS_Mapping
{
public:
@ -51,7 +54,7 @@ public:
return util::current_time() > (creation_time + req_ttl);
}
void Merge(DNS_Mapping* other);
void Merge(const DNS_MappingPtr& other);
static void InitializeCache(FILE* f);
static bool ValidateCacheVersion(FILE* f);