]> granicus.if.org Git - pdns/commitdiff
dnsdist: Use qualified calls to virtual functions in the ctor
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 24 Oct 2019 08:34:20 +0000 (10:34 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 24 Oct 2019 08:41:11 +0000 (10:41 +0200)
Otherwise cppcheck warns that virtual functions should not be called
from the constructor because dynamic binding is not used, and objects
may not have been fully constructed yet. In that case that's fine
because there is no derived classes, but let's make it explicit.

pdns/dnsdistdist/tcpiohandler.cc

index 02b19454b8618d55b58fc54345a716923094fffa..532cfab55260ece5e8b860fb38992d20c04d9561 100644 (file)
@@ -286,7 +286,7 @@ public:
         handleTicketsKeyRotation(time(nullptr));
       }
       else {
-        loadTicketsKeys(fe.d_tlsConfig.d_ticketKeyFile);
+        OpenSSLTLSIOCtx::loadTicketsKeys(fe.d_tlsConfig.d_ticketKeyFile);
       }
     }
     catch (const std::exception& e) {
@@ -351,7 +351,7 @@ public:
     }
   }
 
-  void loadTicketsKeys(const std::string& keyFile) override
+  void loadTicketsKeys(const std::string& keyFile) override final
   {
     d_ticketKeys.loadTicketsKeys(keyFile);
 
@@ -776,7 +776,7 @@ public:
         handleTicketsKeyRotation(time(nullptr));
       }
       else {
-        loadTicketsKeys(fe.d_tlsConfig.d_ticketKeyFile);
+        GnuTLSIOCtx::loadTicketsKeys(fe.d_tlsConfig.d_ticketKeyFile);
       }
     }
     catch(const std::runtime_error& e) {
@@ -827,7 +827,7 @@ public:
     }
   }
 
-  void loadTicketsKeys(const std::string& file) override
+  void loadTicketsKeys(const std::string& file) override final
   {
     if (!d_enableTickets) {
       return;