]> granicus.if.org Git - pdns/commitdiff
auth: Clean up the conn check in GSQLBackend::reconnectIfNeeded()
authorRemi Gacogne <remi.gacogne@powerdns.com>
Sat, 15 Apr 2017 18:28:16 +0000 (20:28 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 13 Jun 2017 13:46:58 +0000 (15:46 +0200)
We have a nice method, let's use it :)

pdns/backends/gsql/gsqlbackend.hh

index 31224b650564fd8dcaa6a7a9820f5ae7d8a9bd68..8fdb2393cfde7fa509f5d6501e6efd63eda9a69b 100644 (file)
@@ -252,10 +252,12 @@ protected:
   }
   virtual void reconnectIfNeeded()
   {
+    if (isConnectionUsable()) {
+      return;
+    }
+
     if (d_db) {
-      if(!d_db->isConnectionUsable()) {
-        d_db->reconnect();
-      }
+      d_db->reconnect();
     }
   }