From b01efc6a1c7ead158452c3c367ab9a947de00d8e Mon Sep 17 00:00:00 2001 From: Nick M Date: Mon, 10 Jul 2023 17:34:49 -0400 Subject: [PATCH 1/2] crash fix for missing transmissions --- trunk-recorder/call_concluder/call_concluder.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trunk-recorder/call_concluder/call_concluder.cc b/trunk-recorder/call_concluder/call_concluder.cc index fb65b3831..8efbe1a35 100644 --- a/trunk-recorder/call_concluder/call_concluder.cc +++ b/trunk-recorder/call_concluder/call_concluder.cc @@ -140,14 +140,18 @@ void remove_call_files(Call_Data_t call_info) { } } else { if (call_info.transmission_archive) { + struct stat statbuf; // if the files are being archived, move them to the capture directory for (std::vector::iterator it = call_info.transmission_list.begin(); it != call_info.transmission_list.end(); ++it) { Transmission t = *it; boost::filesystem::path target_file = boost::filesystem::path(fs::path(call_info.filename ).replace_filename(fs::path(t.filename).filename())); boost::filesystem::path transmission_file = t.filename; //boost::filesystem::path target_file = boost::filesystem::path(call_info.filename).replace_filename(transmission_file.filename()); // takes the capture dir from the call file and adds the transmission filename to it - boost::filesystem::copy_file(transmission_file, target_file); - + + // Only move transmission wavs if they exist + if (stat(t.filename, &statbuf) == 0) { + boost::filesystem::copy_file(transmission_file, target_file); + } } } From cfe8f331e100a21a3437fd1b6ab48c059535a3fc Mon Sep 17 00:00:00 2001 From: Nick M Date: Mon, 10 Jul 2023 17:43:08 -0400 Subject: [PATCH 2/2] better fix --- trunk-recorder/call_concluder/call_concluder.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/trunk-recorder/call_concluder/call_concluder.cc b/trunk-recorder/call_concluder/call_concluder.cc index 8efbe1a35..6bd556e35 100644 --- a/trunk-recorder/call_concluder/call_concluder.cc +++ b/trunk-recorder/call_concluder/call_concluder.cc @@ -140,7 +140,6 @@ void remove_call_files(Call_Data_t call_info) { } } else { if (call_info.transmission_archive) { - struct stat statbuf; // if the files are being archived, move them to the capture directory for (std::vector::iterator it = call_info.transmission_list.begin(); it != call_info.transmission_list.end(); ++it) { Transmission t = *it; @@ -149,9 +148,9 @@ void remove_call_files(Call_Data_t call_info) { //boost::filesystem::path target_file = boost::filesystem::path(call_info.filename).replace_filename(transmission_file.filename()); // takes the capture dir from the call file and adds the transmission filename to it // Only move transmission wavs if they exist - if (stat(t.filename, &statbuf) == 0) { + if (checkIfFile(t.filename)) { boost::filesystem::copy_file(transmission_file, target_file); - } + } } }