From acc697c33acd3da6bcb002805dc6301036147a47 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Mon, 16 Mar 2009 12:43:45 +0100 Subject: [PATCH] Do not use socket call to print IP address when we do have a cached representation. --- src/hubevent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hubevent.c b/src/hubevent.c index d9ae6fa..28ae073 100644 --- a/src/hubevent.c +++ b/src/hubevent.c @@ -23,7 +23,7 @@ void on_login_success(struct user* u) { /* Logging - FIXME: Move this to a plugin */ - const char* addr = net_get_peer_address(u->sd); + const char* addr = ip_convert_to_string(&u->ipaddr); const char* credentials_string[] = { "!none!", "link", "guest", "user", "operator", "super", "admin" }; struct timeval timeout = { TIMEOUT_IDLE, 0 }; @@ -54,7 +54,7 @@ void on_login_success(struct user* u) void on_login_failure(struct user* u, enum status_message msg) { - const char* addr = net_get_peer_address(u->sd); + const char* addr = ip_convert_to_string(&u->ipaddr); const char* message = hub_get_status_message(u->hub, msg); hub_log(log_user, "Login FAIL %s/%s \"%s\" [%s] (%s) \"%s\"", sid_to_string(u->id.sid), u->id.cid, u->id.nick, addr, message, u->user_agent);