From 7a0b4cdc8255d35ca17acbd0b278ef08e14e0dbe Mon Sep 17 00:00:00 2001 From: sowle Date: Tue, 6 May 2025 00:37:09 +0300 Subject: [PATCH] conn_tool: minor improvement --- src/connectivity_tool/conn_tool.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/connectivity_tool/conn_tool.cpp b/src/connectivity_tool/conn_tool.cpp index 2e813674..71da0f4c 100644 --- a/src/connectivity_tool/conn_tool.cpp +++ b/src/connectivity_tool/conn_tool.cpp @@ -1113,7 +1113,7 @@ bool handle_generate_integrated_address(po::variables_map& vm) } //--------------------------------------------------------------------------------------------------------------- template -bool process_archive(archive_processor_t& arch_processor, bool is_packing, std::ifstream& source, std::ofstream& target) +bool process_archive(archive_processor_t& arch_processor, bool is_packing, const std::string& path_target, std::ifstream& source, std::ofstream& target) { source.seekg(0, std::ios::end); uint64_t sz = source.tellg(); @@ -1167,8 +1167,11 @@ bool process_archive(archive_processor_t& arch_processor, bool is_packing, std:: crypto::hash data_hash = hash_stream.calculate_hash(); - std::cout << "\r\nFile " << (is_packing ? "packed" : "unpacked") << " from size " << sz << " to " << written_bytes << - "\r\nhash of the data is " << epee::string_tools::pod_to_hex(data_hash) << "\r\n"; + std::cout << ENDL + << "File " << (is_packing ? "packed" : "unpacked") << " from size " << sz << " to " << written_bytes << ENDL + << "hash of the data is " << epee::string_tools::pod_to_hex(data_hash) << ENDL + << ENDL + << " = { \"" << boost::filesystem::basename(path_target) << "\", \"" << epee::string_tools::pod_to_hex(data_hash) << "\", " << written_bytes << ", " << sz << " }" << ENDL; return true; } @@ -1247,12 +1250,12 @@ bool handle_pack_file(po::variables_map& vm) if (do_pack) { epee::net_utils::gzip_encoder_lyambda gzip_encoder(Z_BEST_SPEED); - return process_archive(gzip_encoder, true, source, target); + return process_archive(gzip_encoder, true, path_target, source, target); } else { epee::net_utils::gzip_decoder_lambda gzip_decoder; - return process_archive(gzip_decoder, false, source, target); + return process_archive(gzip_decoder, false, path_target, source, target); } }