Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / s_misc.c
index 20e8a1842dbe6425d2dcff704ebdcc9dbb86c79a..6cba7aa99df13df70a374115b3299ff2a0bca5c6 100644 (file)
@@ -147,9 +147,7 @@ char *myctime(time_t value)
  *
  *    Returns:
  *      "name[user@ip#.port]" if 'showip' is true;
- *      "name[sockethost]", if name and sockhost are different and
- *      showip is false; else
- *      "name".
+ *      "name" if 'showip' is false.
  *
  *  NOTE 1:
  *    Watch out the allocation of "nbuf", if either sptr->name
@@ -169,12 +167,8 @@ const char* get_client_name(const struct Client* sptr, int showip)
     if (showip)
       sprintf_irc(nbuf, "%s[%s@%s]", sptr->name,
             (IsIdented(sptr)) ? sptr->username : "", sptr->sock_ip);
-    else {
-      if (0 != ircd_strcmp(sptr->name, sptr->sockhost))
-        sprintf_irc(nbuf, "%s[%s]", sptr->name, sptr->sockhost);
-      else
+    else
         return sptr->name;
-    }
     return nbuf;
   }
   return sptr->name;
@@ -256,7 +250,6 @@ static void exit_one_client(struct Client* bcptr, const char* comment)
       Count_clientdisconnects(bcptr, UserStats);
     else {
       Count_remoteclientquits(UserStats, bcptr);
-      ip_registry_remote_disconnect(bcptr);
     }
   }
   else if (IsServer(bcptr))
@@ -279,6 +272,11 @@ static void exit_one_client(struct Client* bcptr, const char* comment)
   else if (IsUnknown(bcptr) || IsConnecting(bcptr) || IsHandshake(bcptr))
     Count_unknowndisconnects(UserStats);
 
+  /*
+   * Update IPregistry
+   */
+  if (IsIPChecked(bcptr))
+    IPcheck_disconnect(bcptr);
 
   /* 
    * Remove from serv->client_list
@@ -302,6 +300,7 @@ static void exit_one_client(struct Client* bcptr, const char* comment)
 #endif
   remove_client_from_list(bcptr);
 }
+
 /*
  * exit_downlinks - added by Run 25-9-94
  *
@@ -379,31 +378,22 @@ int exit_client(struct Client *cptr,    /* Connection being handled by
 {
   struct Client* acptr = 0;
   struct DLink *dlp;
-#ifdef  FNAME_USERLOG
   time_t on_for;
-#endif
+
   char comment1[HOSTLEN + HOSTLEN + 2];
   assert(killer);
   if (MyConnect(victim)) {
     victim->flags |= FLAGS_CLOSING;
     update_load();
-#ifdef FNAME_USERLOG
+
     on_for = CurrentTime - victim->firsttime;
-#if defined(USE_SYSLOG) && defined(SYSLOG_USERS)
-    if (IsUser(victim))
-      ircd_log(L_TRACE, "%s (%3d:%02d:%02d): %s@%s (%s)\n",
-               myctime(victim->firsttime), on_for / 3600, (on_for % 3600) / 60,
-               on_for % 60, victim->user->username, victim->sockhost, victim->name);
-#else
+
     if (IsUser(victim))
-      write_log(FNAME_USERLOG,
-               "%s (%3d:%02d:%02d): %s@%s [%s]\n",
-               myctime(victim->firsttime),
-               on_for / 3600, (on_for % 3600) / 60,
-               on_for % 60,
-               victim->user->username, victim->user->host, victim->username);
-#endif
-#endif
+      log_write(LS_USER, L_TRACE, 0, "%s (%3d:%02d:%02d): %s@%s (%s)",
+               myctime(victim->firsttime), on_for / 3600,
+               (on_for % 3600) / 60, on_for % 60, victim->user->username,
+               victim->sockhost, victim->name);
+
     if (victim != killer->from  /* The source knows already */
         && IsClient(victim))    /* Not a Ping struct or Log file */
     {