]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
remove silly enum for AF_INET and AF_INET6 and in the process discovered auth webserv...
authorbert hubert <bert.hubert@netherlabs.nl>
Wed, 2 Apr 2014 20:09:34 +0000 (22:09 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Wed, 2 Apr 2014 20:09:34 +0000 (22:09 +0200)
pdns/lwres.cc
pdns/sstuff.hh
pdns/webserver.hh

index a68e86aac3a16b5ce0c2f6aa964d109e44a3065e..efdea1b397be7c45fab7d11120b57f7e329964eb 100644 (file)
@@ -101,7 +101,7 @@ int asyncresolve(const ComboAddress& ip, const string& domain, int type, bool do
   }
   else {
     try {
-      Socket s((AddressFamily)ip.sin4.sin_family, Stream);
+      Socket s(ip.sin4.sin_family, SOCK_STREAM);
 
       s.setNonBlocking();
       ComboAddress local = getQueryLocalAddress(ip.sin4.sin_family, 0);
index e77887ddceed5a77314228150dc004589f1cddbc..6adeab95cd61037aaa8292af05850bbcc353d2f7 100644 (file)
@@ -31,24 +31,14 @@ public:
 };
 
 
-enum AddressFamily {InterNetwork=AF_INET, InterNetwork6 = AF_INET6}; //!< Supported address families
-enum SocketType {Datagram=SOCK_DGRAM,Stream=SOCK_STREAM}; //!< Supported socket families
 typedef int ProtocolType; //!< Supported protocol types
 
 //! Representation of a Socket and many of the Berkeley functions available
 class Socket : public boost::noncopyable
 {
-private:
-  explicit Socket(int fd, AddressFamily af)
-  {
-    d_family=af;
-    d_buflen=4096;
-    d_buffer=new char[d_buflen];
-    d_socket=fd;
-  }
 public:
-  //! Construct a socket of specified AddressFamily and SocketType.
-  Socket(AddressFamily af, SocketType st, ProtocolType pt=0)
+  //! Construct a socket of specified address family and socket type.
+  Socket(int af, int st, ProtocolType pt=0)
   {
     d_family=af;
     if((d_socket=(int)socket(af,st, pt))<0)
@@ -327,7 +317,7 @@ private:
   int d_socket;
   char *d_buffer;
   int d_buflen;
-  AddressFamily d_family;
+  int d_family;
 };
 
 
index f627376b55542fbe0d468e4c487fe46381b039af..e9fabd282563c8e18d90004c839d10a52d46504c 100644 (file)
@@ -108,7 +108,7 @@ public:
 class Server
 {
 public:
-  Server(const string &localaddress, int port) : d_local(localaddress.empty() ? "0.0.0.0" : localaddress, port), d_server_socket(InterNetwork, Stream, 0) {
+  Server(const string &localaddress, int port) : d_local(localaddress.empty() ? "0.0.0.0" : localaddress, port), d_server_socket(d_local.sin4.sin_family, SOCK_STREAM, 0) {
     d_server_socket.setReuseAddr();
     d_server_socket.bind(d_local);
     d_server_socket.listen();