From 992b41b82aef375732b3101d76f6530130b4a56b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 19 Nov 2016 13:12:07 -0500 Subject: [PATCH] TLSClient: Improved C++ core guidelines --- src/TLSClient.cpp | 15 --------------- src/TLSClient.h | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 28 deletions(-) diff --git a/src/TLSClient.cpp b/src/TLSClient.cpp index c467517ee..8f7653db8 100644 --- a/src/TLSClient.cpp +++ b/src/TLSClient.cpp @@ -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 () { diff --git a/src/TLSClient.h b/src/TLSClient.h index 444d9ffa6..b51aa38c1 100644 --- a/src/TLSClient.h +++ b/src/TLSClient.h @@ -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