]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/dynlistener.hh
Merge pull request #9073 from pieterlexis/runtime-dirs-virtual-hosting
[thirdparty/pdns.git] / pdns / dynlistener.hh
index 421751d89713f6438ba970ff639a45eec7d612b4..cbe45c47b53ab1f03d6a69a7dcc5216597bd78b2 100644 (file)
@@ -1,30 +1,27 @@
 /*
-    PowerDNS Versatile Database Driven Nameserver
-    Copyright (C) 2002 - 2008 PowerDNS.COM BV
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License version 2
-    as published by the Free Software Foundation
-
-    Additionally, the license of this program contains a special
-    exception which allows to distribute the program in binary form when
-    it is linked against OpenSSL.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-#ifndef PDNS_DYNLISTENER
-#define PDNS_DYNLISTENER
-
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
 #include <string>
 #include <vector>
-#include <pthread.h>
 #include <sys/types.h>
 #include <errno.h>
 #include <iostream>
@@ -47,7 +44,6 @@ public:
   ~DynListener();
   void go();
   void theListener();
-  static void *theListenerHelper(void *p);
 
   typedef string g_funk_t(const vector<string> &parts, Utility::pid_t ppid); // guido!
   typedef struct { g_funk_t *func; string args; string usage; } g_funkwithusage_t;
@@ -66,12 +62,11 @@ private:
   void createSocketAndBind(int family, struct sockaddr*local, size_t len);
 
   NetmaskGroup d_tcprange;
-  int d_s;
-  int d_client;
-  pthread_t d_tid;
+  int d_s{-1};
+  int d_client{-1};
   bool d_nonlocal;
-  bool d_tcp;
-  pid_t d_ppid;
+  bool d_tcp{false};
+  pid_t d_ppid{0};
   
   string d_socketname;
   ComboAddress d_socketaddress;
@@ -79,4 +74,3 @@ private:
   static g_funk_t* s_restfunc;
   bool testLive(const string& fname);
 };
-#endif /* PDNS_DYNLISTENER */