]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Apply suggestions from code review
authorOtto Moerbeek <otto@drijf.net>
Fri, 5 Feb 2021 11:22:39 +0000 (12:22 +0100)
committerOtto <otto.moerbeek@open-xchange.com>
Fri, 5 Feb 2021 11:30:55 +0000 (12:30 +0100)
Co-authored-by: Remi Gacogne <rgacogne+github@valombre.net>
pdns/tcpiohandler.cc

index 13aefa77c62e21bf7ad8291ad0796d16a1d7ea05..b510dd03a964e4063f3f29df7441ed77473c0c6b 100644 (file)
@@ -526,12 +526,12 @@ public:
   {
     handleTicketsKeyRotation(now);
 
-    return std::unique_ptr<OpenSSLTLSConnection>(new OpenSSLTLSConnection(socket, timeout, d_feContext));
+    return std::make_unique<OpenSSLTLSConnection>(socket, timeout, d_feContext);
   }
 
   std::unique_ptr<TLSConnection> getClientConnection(const std::string& host, int socket, unsigned int timeout) override
   {
-    return std::unique_ptr<OpenSSLTLSConnection>(new OpenSSLTLSConnection(host, socket, timeout, d_tlsCtx.get()));
+    return std::make_unique<OpenSSLTLSConnection>(host, socket, timeout, d_tlsCtx.get());
   }
 
   void rotateTicketsKey(time_t now) override
@@ -1148,12 +1148,12 @@ public:
       ticketsKey = d_ticketsKey;
     }
 
-    return std::unique_ptr<GnuTLSConnection>(new GnuTLSConnection(socket, timeout, d_creds.get(), d_priorityCache, ticketsKey, d_enableTickets));
+    return std::make_unique<GnuTLSConnection>(socket, timeout, d_creds.get(), d_priorityCache, ticketsKey, d_enableTickets);
   }
 
   std::unique_ptr<TLSConnection> getClientConnection(const std::string& host, int socket, unsigned int timeout) override
   {
-    return std::unique_ptr<GnuTLSConnection>(new GnuTLSConnection(host, socket, timeout, d_creds.get(), d_priorityCache, d_validateCerts));
+    return std::make_unique<GnuTLSConnection>(host, socket, timeout, d_creds.get(), d_priorityCache, d_validateCerts);
   }
 
   void rotateTicketsKey(time_t now) override