TLSClient: Improved C++ core guidelines

This commit is contained in:
Paul Beckingham 2016-11-19 13:12:07 -05:00
parent 3be7803d30
commit 992b41b82a
2 changed files with 13 additions and 28 deletions

View file

@ -66,21 +66,6 @@ static int verify_certificate_callback (gnutls_session_t session)
return client->verify_certificate ();
}
////////////////////////////////////////////////////////////////////////////////
TLSClient::TLSClient ()
: _ca ("")
, _cert ("")
, _key ("")
, _host ("")
, _port ("")
, _session(0)
, _socket (0)
, _limit (0)
, _debug (false)
, _trust(strict)
{
}
////////////////////////////////////////////////////////////////////////////////
TLSClient::~TLSClient ()
{

View file

@ -36,7 +36,7 @@ class TLSClient
public:
enum trust_level { strict, ignore_hostname, allow_all };
TLSClient ();
TLSClient () = default;
~TLSClient ();
void limit (int);
void debug (int);
@ -51,18 +51,18 @@ public:
void recv (std::string&);
private:
std::string _ca;
std::string _cert;
std::string _key;
std::string _ciphers;
std::string _host;
std::string _port;
gnutls_certificate_credentials_t _credentials;
gnutls_session_t _session;
int _socket;
int _limit;
bool _debug;
enum trust_level _trust;
std::string _ca {""};
std::string _cert {""};
std::string _key {""};
std::string _ciphers {""};
std::string _host {""};
std::string _port {""};
gnutls_certificate_credentials_t _credentials {};
gnutls_session_t _session {0};
int _socket {0};
int _limit {0};
bool _debug {false};
enum trust_level _trust {strict};
};
#endif