Changeset View
Changeset View
Standalone View
Standalone View
head/security/snort3/files/patch-src_file__api_file__cache.cc
--- src/file_api/file_cache.cc.orig 2019-04-10 20:51:55 UTC | --- src/file_api/file_cache.cc.orig 2020-03-25 14:13:20 UTC | ||||
+++ src/file_api/file_cache.cc | +++ src/file_api/file_cache.cc | ||||
@@ -134,7 +134,7 @@ FileContext* FileCache::add(const FileHashKey& hashKey | @@ -133,7 +133,7 @@ FileContext* FileCache::add(const FileHashKey& hashKey | ||||
struct timeval now; | struct timeval now; | ||||
packet_gettimeofday(&now); | packet_gettimeofday(&now); | ||||
- struct timeval time_to_add = { timeout, 0 }; | - struct timeval time_to_add = { timeout, 0 }; | ||||
+ struct timeval time_to_add = { static_cast<time_t>(timeout), 0 }; | + struct timeval time_to_add = { static_cast<time_t>(timeout), 0 }; | ||||
timeradd(&now, &time_to_add, &new_node.cache_expire_time); | timeradd(&now, &time_to_add, &new_node.cache_expire_time); | ||||
new_node.file = new FileContext; | new_node.file = new FileContext; | ||||
@@ -187,7 +187,7 @@ FileContext* FileCache::find(const FileHashKey& hashKe | @@ -183,7 +183,7 @@ FileContext* FileCache::find(const FileHashKey& hashKe | ||||
} | } | ||||
struct timeval next_expire_time; | struct timeval next_expire_time; | ||||
- struct timeval time_to_add = { timeout, 0 }; | - struct timeval time_to_add = { timeout, 0 }; | ||||
+ struct timeval time_to_add = { static_cast<time_t>(timeout), 0 }; | + struct timeval time_to_add = { static_cast<time_t>(timeout), 0 }; | ||||
timeradd(&now, &time_to_add, &next_expire_time); | timeradd(&now, &time_to_add, &next_expire_time); | ||||
// Refresh the timer on the cache. | // Refresh the timer on the cache. | ||||
@@ -314,7 +314,7 @@ bool FileCache::apply_verdict(Packet* p, FileContext* | @@ -311,7 +311,7 @@ bool FileCache::apply_verdict(Packet* p, FileContext* | ||||
if (!timerisset(&file_ctx->pending_expire_time)) | if (!timerisset(&file_ctx->pending_expire_time)) | ||||
{ | { | ||||
- add_time = { lookup_timeout, 0 }; | - add_time = { lookup_timeout, 0 }; | ||||
+ add_time = { static_cast<time_t>(lookup_timeout), 0 }; | + add_time = { static_cast<time_t>(lookup_timeout), 0 }; | ||||
timeradd(&now, &add_time, &file_ctx->pending_expire_time); | timeradd(&now, &add_time, &file_ctx->pending_expire_time); | ||||
if (PacketTracer::is_active()) | if (PacketTracer::is_active()) |