fixed/improved logging
authorChristian Thaeter <ct@pipapo.org>
Sun, 4 Nov 2007 21:17:15 +0000 (22:17 +0100)
committerChristian Thaeter <ct@pipapo.org>
Mon, 5 Nov 2007 06:08:15 +0000 (07:08 +0100)
src/rxpd_connection.c
src/rxpd_socket.c

index 4d5df03..c6cc816 100644 (file)
@@ -67,7 +67,14 @@ rxpd_connection_cleanup (void* ptr)
   llist_unlink (&self->node);
   close (self->fd);
   self->fd = -1;
-  rxpd_log (NULL, LOG_DEBUG, "connection canceled\n");
+
+  char buf[512];
+  *buf = '\0';
+  if (self->socket->rxpd_socket_addr (self, buf, "", 511))
+    {
+      rxpd_log (NULL, LOG_DEBUG, "connection %s terminated\n", buf);
+    }
+
   rxpd_connection_delete (self);
 }
 
index 80f4fed..d634a98 100644 (file)
@@ -174,7 +174,7 @@ rxpd_socket_accept (void* ptr)
       char buf[512];
       *buf = '\0';
 
-      if (rxpd_socket_tcp4addr (conn, buf, "", 511))
+      if (self->rxpd_socket_addr (conn, buf, "", 511))
         {
           rxpd_log (self->base, LOG_INFO, "incoming connection '%s'\n", buf);
           rxpd_connection_spawn (conn);