Code

Frontend: Improve debug log when destroying a connection.
authorSebastian Harl <sh@tokkee.org>
Fri, 11 Apr 2014 07:15:56 +0000 (09:15 +0200)
committerSebastian Harl <sh@tokkee.org>
Fri, 11 Apr 2014 07:15:56 +0000 (09:15 +0200)
The file-descriptor associated with the connection might not be open any more
and, thus, be -1. Instead of using that in the message, use the connection's
object name which includes the file-descriptor as used when accepting the
connection.

src/frontend/connection.c

index 1fa4ba98c6888a726f8e921cce82f9d7e1d8900a..b98987dd2e53b68ddf828e64c0bb67e61f01bba4 100644 (file)
@@ -140,8 +140,7 @@ connection_destroy(sdb_object_t *obj)
                                        "(%zu byte%s left in buffer)", len, len == 1 ? "" : "s");
        }
 
-       sdb_log(SDB_LOG_DEBUG, "frontend: Closing connection on fd=%i",
-                       conn->fd);
+       sdb_log(SDB_LOG_DEBUG, "frontend: Closing connection %s", obj->name);
        if (conn->fd >= 0)
                close(conn->fd);
        conn->fd = -1;