libt2n: (tomj) documented code problems; have to find out if this is the source of...
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 24 Nov 2008 19:43:16 +0000 (19:43 +0000)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 24 Nov 2008 19:43:16 +0000 (19:43 +0000)
src/command_server.hxx
src/connection.cpp
src/socket_client.cpp
src/socket_handler.hxx
src/socket_server.cpp
src/socket_wrapper.hxx

index c839e78..04508b5 100644 (file)
@@ -41,6 +41,7 @@ class command_server
 
     public:
         command_server(server& _s);
+        // TODO: No (virtual) destructor
 
         void handle(long long usec_timeout=-1, long long* usec_timeout_remaining=NULL);
 
index c9283fe..cc543b2 100644 (file)
@@ -32,6 +32,7 @@ namespace libt2n
 connection::~connection()
 {
     // we want the connection_closed callbacks to be called before
+    // FIXME: Functios is virtual
     close();
 
     do_callbacks(connection_deleted);
index 360e5f0..bd321fb 100644 (file)
@@ -94,6 +94,7 @@ socket_client_connection::socket_client_connection(const std::string& _path,
     {
         lastErrorMsg=e.what();
         LOGSTREAM(debug,"unix connect error: " << lastErrorMsg);
+        // FIXME: Calls virtual function close in constructor
         close();
     }
 
index 799913e..b91a505 100644 (file)
@@ -48,6 +48,7 @@ class socket_handler
         long long write_timeout;
 
         socket_handler(int _sock, socket_type_value _socket_type);
+        // TODO: No destructor?
 
         void set_socket_options(int sock);
 
index e2110bd..ad8bb84 100644 (file)
@@ -67,7 +67,10 @@ socket_server::socket_server(int port, const std::string& ip)
         EXCEPTIONSTREAM(error,t2n_server_error,"failed listening on invalid ip " << ip);
 
     if (bind (sock, (struct sockaddr *) &sockaddr, sizeof (sockaddr)) < 0)
+    {
+        // FIXME: Calls virtual function socket_server::get_logstream() in constructor
         EXCEPTIONSTREAM(error,t2n_server_error,"error binding socket: " << strerror(errno));
+    }
 
     start_listening();
 }
@@ -83,6 +86,8 @@ socket_server::socket_server(const std::string& path, mode_t filemode, const std
 {
     unix_path=path;
 
+    // TODO: Every EXCEPTIONSTREAM in here calls virtual function get_logstream()
+
     /* Create the socket. */
     sock = socket (PF_UNIX, SOCK_STREAM, 0);
     if (sock < 0)
index 067931e..093a809 100644 (file)
@@ -52,6 +52,9 @@ class BasicSocketWrapper : public ConnectionWrapper
 
         std::auto_ptr<socket_client_connection> c;
 
+        // TODO: Mark object as non-copyable as it contains an auto_ptr.
+        //       This will make sure nobody every tries to put this in a STL container
+
     public:
         BasicSocketWrapper(int _port, const std::string& _server="127.0.0.1", 
             long long _connect_timeout_usec=socket_client_connection::connect_timeout_usec_default,