diff --git a/repertory/repertory/src/ui/handlers.cpp b/repertory/repertory/src/ui/handlers.cpp index 588e642e..197ed935 100644 --- a/repertory/repertory/src/ui/handlers.cpp +++ b/repertory/repertory/src/ui/handlers.cpp @@ -88,7 +88,6 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server) lines.erase(lines.begin()); auto result = nlohmann::json::parse(utils::string::join(lines, '\n')); - fmt::println("{}", result.dump()); res.set_content(result.dump(), "application/json"); res.status = http_error_codes::ok; }); @@ -124,7 +123,6 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server) process_dir("s3"); process_dir("sia"); - fmt::println("{}", result.dump()); res.set_content(result.dump(), "application/json"); res.status = http_error_codes::ok; }); @@ -186,7 +184,6 @@ auto handlers::read_process(provider_type type, std::string_view name, } auto cmd_line = fmt::format("repertory {} {}", str_type, command); - fmt::println("{}", cmd_line); auto *pipe = popen(cmd_line.c_str(), "r"); if (pipe == nullptr) { @@ -196,11 +193,8 @@ auto handlers::read_process(provider_type type, std::string_view name, std::string data; std::array buffer{}; while (feof(pipe) == 0) { - auto *str = fgets(buffer.data(), buffer.size(), pipe); - if (str != nullptr) { - data.insert(data.end(), buffer.begin(), - std::next(buffer.begin(), static_cast( - strnlen(str, buffer.size())))); + while (fgets(buffer.data(), buffer.size(), pipe) != nullptr) { + data += buffer.data(); } } pclose(pipe);