summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 23844d9)
raw | patch | inline | side by side (parent: 23844d9)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 22 Feb 2015 18:38:31 +0000 (19:38 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 22 Feb 2015 18:38:31 +0000 (19:38 +0100) |
src/frontend/connection.c | patch | blob | history |
index 117c6ae18adab025f667fab709c3997b7b0618e6..ebc3b99332d92d0e929f51467edbc549f0088630 100644 (file)
"(%zu byte%s left in buffer)", len, len == 1 ? "" : "s");
}
- sdb_log(SDB_LOG_DEBUG, "frontend: Closing connection %s", obj->name);
+ if (conn->client_addr.ss_family == AF_UNIX) {
+ sdb_log(SDB_LOG_DEBUG, "frontend: Closing connection %s from peer %s",
+ obj->name, conn->username);
+ }
+ else {
+ char host[1024] = "<unknown>", port[32] = "";
+ getnameinfo((struct sockaddr *)&conn->client_addr,
+ conn->client_addr_len, host, sizeof(host), port, sizeof(port),
+ NI_NUMERICHOST | NI_NUMERICSERV);
+ sdb_log(SDB_LOG_DEBUG, "frontend: Closing connection %s from peer %s "
+ "at %s:%s", obj->name, conn->username, host, port);
+ }
sdb_connection_close(conn);
if (conn->username)