|
@@ -49,9 +49,13 @@ std::string pcap_processor::merge_pcaps(const std::string pcap_path) {
|
|
|
strftime(buff, sizeof(buff), "%Y%m%d-%H%M%S", now);
|
|
|
std::string tstmp(buff);
|
|
|
|
|
|
- // Replace filename with 'timestamp_filename'
|
|
|
+ // Calculate hash of the temporary pcap name
|
|
|
+ std::hash<std::string> hash_fn;
|
|
|
+ std::string hashstr = std::to_string(hash_fn(pcap_path));
|
|
|
+
|
|
|
+ // Replace filename with 'filename_timestamp_hash'
|
|
|
std::string new_filepath = filePath;
|
|
|
- const std::string &newExt = "_" + tstmp + ".pcap";
|
|
|
+ const std::string &newExt = "_" + tstmp + "_" + hashstr + ".pcap";
|
|
|
std::string::size_type h = new_filepath.rfind('.', new_filepath.length());
|
|
|
|
|
|
if ((filePath.length() + newExt.length()) < 250) {
|