File handler client info is C++ object now.
This commit is contained in:
+12
-8
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user