From 65dceb8c253d4cd9da0fd2b34b8a61362101b21c Mon Sep 17 00:00:00 2001 From: cy33hc Date: Sat, 30 May 2026 21:31:02 -0700 Subject: [PATCH] remove some redundant code --- source/clients/nfsclient.cpp | 1 + source/main.cpp | 7 +++---- source/server/http_server.cpp | 23 ++++++----------------- 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/source/clients/nfsclient.cpp b/source/clients/nfsclient.cpp index a9443f4..286b5c4 100644 --- a/source/clients/nfsclient.cpp +++ b/source/clients/nfsclient.cpp @@ -50,6 +50,7 @@ int NfsClient::Connect(const std::string &url, const std::string &user, const st nfs = nullptr; return 0; } + nfs_destroy_url(nfsurl); connected = true; diff --git a/source/main.cpp b/source/main.cpp index 109a284..bb0ff52 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -11,7 +11,7 @@ #include "server/http_server.h" #include "config.h" #include "util.h" -#include "dbglogger.h" +// #include "dbglogger.h" extern "C" { @@ -65,7 +65,6 @@ static void NetTerm(void) static void OnSignal() { - dbglogger_log("Terminating OnSignal"); HttpServer::Stop(); HttpServer::StopDownloadThread(); } @@ -78,8 +77,8 @@ int main(int argc, char *argv[]) return -1; } - dbglogger_init(); - dbglogger_log("If you see this you've set up dbglogger correctly."); + // dbglogger_init(); + // dbglogger_log("If you see this you've set up dbglogger correctly."); CONFIG::LoadPackageInstallHostData(); CONFIG::LoadBgDownloadData(); diff --git a/source/server/http_server.cpp b/source/server/http_server.cpp index aaeb5ee..0aebc77 100644 --- a/source/server/http_server.cpp +++ b/source/server/http_server.cpp @@ -128,23 +128,7 @@ namespace HttpServer { tmp_client = new ArchiveOrgClient(); } - else if (host_info->http_server_type.compare(HTTP_SERVER_APACHE)) - { - tmp_client = new BaseClient(); - } - else if (host_info->http_server_type.compare(HTTP_SERVER_MS_IIS)) - { - tmp_client = new BaseClient(); - } - else if (host_info->http_server_type.compare(HTTP_SERVER_NGINX)) - { - tmp_client = new BaseClient(); - } - else if (host_info->http_server_type.compare(HTTP_SERVER_RCLONE)) - { - tmp_client = new BaseClient(); - } - else if (host_info->http_server_type.compare(HTTP_SERVER_NPX_SERVE)) + else { tmp_client = new BaseClient(); } @@ -201,6 +185,11 @@ namespace HttpServer if (bg_download_list[i].state == STATE_PENDING) { RemoteClient *tmp_client = GetRemoteClient(&(bg_download_list[i].host_info)); + if (tmp_client == nullptr) + { + break; + } + g_bytes_transfered = &(bg_download_list[i].bytes_transfered); if (bg_download_list[i].host_info.type == CLIENT_TYPE_FTP) {