MXS-2483: Return std::unique_ptr from SSLContext::create
Smart pointers are far nicer than raw pointers.
This commit is contained in:
@ -251,7 +251,7 @@ private:
|
||||
*/
|
||||
Listener(SERVICE* service, const std::string& name, const std::string& address, uint16_t port,
|
||||
const std::string& protocol, const std::string& authenticator,
|
||||
const std::string& auth_opts, void* auth_instance, mxs::SSLContext* ssl,
|
||||
const std::string& auth_opts, void* auth_instance, std::unique_ptr<mxs::SSLContext> ssl,
|
||||
const MXS_CONFIG_PARAMETER& params);
|
||||
|
||||
/**
|
||||
|
||||
@ -528,9 +528,9 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
SERVER(mxs::SSLContext* ssl_context = nullptr)
|
||||
SERVER(std::unique_ptr<mxs::SSLContext> ssl_context)
|
||||
: m_response_time{0.04, 0.35, 500}
|
||||
, m_ssl_context{ssl_context}
|
||||
, m_ssl_context{std::move(ssl_context)}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ public:
|
||||
*
|
||||
* @return A new SSL configuration or nullptr on error
|
||||
*/
|
||||
static SSLContext* create(const MXS_CONFIG_PARAMETER& params);
|
||||
static std::unique_ptr<SSLContext> create(const MXS_CONFIG_PARAMETER& params);
|
||||
|
||||
/**
|
||||
* Serialize the SSL configuration into a INI file section
|
||||
|
||||
Reference in New Issue
Block a user