From 4fa86606cc95cc7dc3c42db0969dd0f0ccb85f41f4411d204155f5de4e3ab72d Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Tue, 5 May 2026 17:39:39 -0400 Subject: [PATCH] File handler client info is C++ object now. --- dpi/file.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/dpi/file.cc b/dpi/file.cc index 8296862..b96f093 100644 --- a/dpi/file.cc +++ b/dpi/file.cc @@ -101,6 +101,8 @@ struct ClientInfo { int err_code; int flags; int old_style; + + ~ClientInfo(); }; /* @@ -916,16 +918,18 @@ static ClientInfo *File_add_client(int sock_fd) static void File_remove_client(ClientInfo *client) { Clients.erase( std::find( begin( Clients ), end( Clients ), client ) ); + delete client; +} +ClientInfo::~ClientInfo() +{ _MSG("Closing Socket Handler\n"); - a_Dpip_dsh_close(client->sh); - a_Dpip_dsh_free(client->sh); - File_close(client->file_fd); - dFree(client->orig_url); - dFree(client->filename); - File_dillodir_free(client->d_dir); - - dFree(client); + a_Dpip_dsh_close(sh); + a_Dpip_dsh_free(sh); + File_close(file_fd); + dFree(orig_url); + dFree(filename); + File_dillodir_free(d_dir); } /*