fix: move SSL params classes to standalone header to resolve circular includes

Servers_SslParams, MySQLServers_SslParams, and PgSQLServers_SslParams
are now in Servers_SslParams.h with minimal dependencies (<string> only).
This avoids the circular include issue between cpp.h, mysql_connection.h,
and Base_HostGroups_Manager.h that caused incomplete type errors.
pull/5583/head
Rahim Kanji 1 month ago
parent 6d3ce36de4
commit 7fa0e82bd7

@ -450,74 +450,6 @@ class AWS_Aurora_Info {
~AWS_Aurora_Info();
};
class Servers_SslParams {
public:
string hostname;
int port;
string username;
string ssl_ca;
string ssl_cert;
string ssl_key;
string ssl_capath;
string ssl_crl;
string ssl_crlpath;
string ssl_cipher;
string tls_version;
string comment;
string MapKey;
Servers_SslParams(string _h, int _p, string _u,
string ca, string cert, string key, string capath,
string crl, string crlpath, string cipher, string tls,
string c) {
hostname = _h;
port = _p;
username = _u;
ssl_ca = ca;
ssl_cert = cert;
ssl_key = key;
ssl_capath = capath;
ssl_crl = crl;
ssl_crlpath = crlpath;
ssl_cipher = cipher;
tls_version = tls;
comment = c;
MapKey = "";
}
Servers_SslParams(char * _h, int _p, char * _u,
char * ca, char * cert, char * key, char * capath,
char * crl, char * crlpath, char * cipher, char * tls,
char * c) {
hostname = string(_h);
port = _p;
username = string(_u);
ssl_ca = string(ca);
ssl_cert = string(cert);
ssl_key = string(key);
ssl_capath = string(capath);
ssl_crl = string(crl);
ssl_crlpath = string(crlpath);
ssl_cipher = string(cipher);
tls_version = string(tls);
comment = string(c);
MapKey = "";
}
Servers_SslParams(string _h, int _p, string _u) {
Servers_SslParams(_h, _p, _u, "", "", "", "", "", "", "", "", "");
}
virtual ~Servers_SslParams() = default;
string getMapKey(const char *del) {
if (MapKey == "") {
MapKey = hostname + string(del) + to_string(port) + string(del) + username;
}
return MapKey;
}
};
class MySQLServers_SslParams : public Servers_SslParams {
public:
using Servers_SslParams::Servers_SslParams;
};
struct p_hg_counter {
enum metric {
servers_table_version = 0,

@ -360,11 +360,6 @@ class AWS_Aurora_Info {
~AWS_Aurora_Info();
};
class MySQLServers_SslParams : public Servers_SslParams {
public:
using Servers_SslParams::Servers_SslParams;
};
struct p_hg_counter {
enum metric {
servers_table_version = 0,

@ -173,11 +173,6 @@ class PgSQL_SrvConnList {
PgSQL_Connection *index(unsigned int);
};
class PgSQLServers_SslParams : public Servers_SslParams {
public:
using Servers_SslParams::Servers_SslParams;
};
class PgSQL_SrvC { // MySQL Server Container
public:
PgSQL_HGC *myhgc;

@ -0,0 +1,82 @@
#ifndef __CLASS_SERVERS_SSL_PARAMS_H
#define __CLASS_SERVERS_SSL_PARAMS_H
#include <string>
using std::string;
using std::to_string;
class Servers_SslParams {
public:
string hostname;
int port;
string username;
string ssl_ca;
string ssl_cert;
string ssl_key;
string ssl_capath;
string ssl_crl;
string ssl_crlpath;
string ssl_cipher;
string tls_version;
string comment;
string MapKey;
Servers_SslParams(string _h, int _p, string _u,
string ca, string cert, string key, string capath,
string crl, string crlpath, string cipher, string tls,
string c) {
hostname = _h;
port = _p;
username = _u;
ssl_ca = ca;
ssl_cert = cert;
ssl_key = key;
ssl_capath = capath;
ssl_crl = crl;
ssl_crlpath = crlpath;
ssl_cipher = cipher;
tls_version = tls;
comment = c;
MapKey = "";
}
Servers_SslParams(char * _h, int _p, char * _u,
char * ca, char * cert, char * key, char * capath,
char * crl, char * crlpath, char * cipher, char * tls,
char * c) {
hostname = string(_h);
port = _p;
username = string(_u);
ssl_ca = string(ca);
ssl_cert = string(cert);
ssl_key = string(key);
ssl_capath = string(capath);
ssl_crl = string(crl);
ssl_crlpath = string(crlpath);
ssl_cipher = string(cipher);
tls_version = string(tls);
comment = string(c);
MapKey = "";
}
Servers_SslParams(string _h, int _p, string _u) {
Servers_SslParams(_h, _p, _u, "", "", "", "", "", "", "", "", "");
}
virtual ~Servers_SslParams() = default;
string getMapKey(const char *del) {
if (MapKey == "") {
MapKey = hostname + string(del) + to_string(port) + string(del) + username;
}
return MapKey;
}
};
class MySQLServers_SslParams : public Servers_SslParams {
public:
using Servers_SslParams::Servers_SslParams;
};
class PgSQLServers_SslParams : public Servers_SslParams {
public:
using Servers_SslParams::Servers_SslParams;
};
#endif // __CLASS_SERVERS_SSL_PARAMS_H

@ -26,7 +26,7 @@
#define STATUS_MYSQL_CONNECTION_HAS_SAVEPOINT 0x00000800
#define STATUS_MYSQL_CONNECTION_HAS_WARNINGS 0x00001000
class MySQLServers_SslParams;
#include "Servers_SslParams.h"
class Variable {
public:

Loading…
Cancel
Save