]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
broke our socket stuff as part of our cleanup - spotted by Christian Hofstädtler
authorbert hubert <bert.hubert@netherlabs.nl>
Wed, 2 Apr 2014 20:35:58 +0000 (22:35 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Wed, 2 Apr 2014 20:35:58 +0000 (22:35 +0200)
pdns/sstuff.hh

index 6adeab95cd61037aaa8292af05850bbcc353d2f7..81171f5c17f8760d8a3fb73594dd06889393647a 100644 (file)
@@ -36,11 +36,17 @@ typedef int ProtocolType; //!< Supported protocol types
 //! Representation of a Socket and many of the Berkeley functions available
 class Socket : public boost::noncopyable
 {
+  Socket(int fd)
+  {
+    d_socket = fd;
+    d_buflen=4096;
+    d_buffer=new char[d_buflen];
+  }
+
 public:
   //! 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)
       throw NetworkError(strerror(errno));
     Utility::setCloseOnExec(d_socket);
@@ -69,7 +75,7 @@ public:
       throw NetworkError("Accepting a connection: "+string(strerror(errno)));
     }
 
-    return new Socket(s, d_family);
+    return new Socket(s);
   }
 
   //! Set the socket to non-blocking
@@ -317,7 +323,6 @@ private:
   int d_socket;
   char *d_buffer;
   int d_buflen;
-  int d_family;
 };