Convert connection byte counters to 64-bit integers.
[ircu2.10.12-pk.git] / ircd / s_misc.c
index 1371be9423f53f73b9d6627d4772a102971bf517..1b892fc287169dba7277fa24d1b452289a21b232 100644 (file)
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
+ */
+/** @file
+ * @brief Miscellaneous support functions.
+ * @version $Id$
  */
 #include "config.h"
 
@@ -200,6 +202,7 @@ void get_sockhost(struct Client *cptr, char *host)
 static void exit_one_client(struct Client* bcptr, const char* comment)
 {
   struct SLink *lp;
+  struct Ban *bp;
 
   if (cli_serv(bcptr) && cli_serv(bcptr)->client_list)  /* Was SetServerYXX called ? */
     ClearServerYXX(bcptr);      /* Removes server from server_list[] */
@@ -213,7 +216,6 @@ static void exit_one_client(struct Client* bcptr, const char* comment)
      * Stop a running /LIST clean
      */
     if (MyUser(bcptr) && cli_listing(bcptr)) {
-      cli_listing(bcptr)->chptr->mode.mode &= ~MODE_LISTED;
       MyFree(cli_listing(bcptr));
       cli_listing(bcptr) = NULL;
     }
@@ -232,8 +234,10 @@ static void exit_one_client(struct Client* bcptr, const char* comment)
       del_invite(bcptr, lp->value.chptr);
 
     /* Clean up silencefield */
-    while ((lp = cli_user(bcptr)->silence))
-      del_silence(bcptr, lp->value.cp);
+    while ((bp = cli_user(bcptr)->silence)) {
+      cli_user(bcptr)->silence = bp->next;
+      free_ban(bp);
+    }
 
     /* Clean up snotice lists */
     if (MyUser(bcptr))
@@ -579,39 +583,15 @@ void tstats(struct Client *cptr, const struct StatDesc *sd, char *param)
     {
       sp->is_sbs += cli_sendB(acptr);
       sp->is_sbr += cli_receiveB(acptr);
-      sp->is_sks += cli_sendK(acptr);
-      sp->is_skr += cli_receiveK(acptr);
       sp->is_sti += CurrentTime - cli_firsttime(acptr);
       sp->is_sv++;
-      if (sp->is_sbs > 1023)
-      {
-        sp->is_sks += (sp->is_sbs >> 10);
-        sp->is_sbs &= 0x3ff;
-      }
-      if (sp->is_sbr > 1023)
-      {
-        sp->is_skr += (sp->is_sbr >> 10);
-        sp->is_sbr &= 0x3ff;
-      }
     }
     else if (IsUser(acptr))
     {
       sp->is_cbs += cli_sendB(acptr);
       sp->is_cbr += cli_receiveB(acptr);
-      sp->is_cks += cli_sendK(acptr);
-      sp->is_ckr += cli_receiveK(acptr);
       sp->is_cti += CurrentTime - cli_firsttime(acptr);
       sp->is_cl++;
-      if (sp->is_cbs > 1023)
-      {
-        sp->is_cks += (sp->is_cbs >> 10);
-        sp->is_cbs &= 0x3ff;
-      }
-      if (sp->is_cbr > 1023)
-      {
-        sp->is_ckr += (sp->is_cbr >> 10);
-        sp->is_cbr &= 0x3ff;
-      }
     }
     else if (IsUnknown(acptr))
       sp->is_ni++;
@@ -634,10 +614,10 @@ void tstats(struct Client *cptr, const struct StatDesc *sd, char *param)
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Client server");
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":connected %u %u",
             sp->is_cl, sp->is_sv);
-  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":bytes sent %u.%uK %u.%uK",
-            sp->is_cks, sp->is_cbs, sp->is_sks, sp->is_sbs);
-  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":bytes recv %u.%uK %u.%uK",
-            sp->is_ckr, sp->is_cbr, sp->is_skr, sp->is_sbr);
-  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":time connected %Tu %Tu",
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":bytes sent %Lu %Lu",
+            sp->is_cbs, sp->is_sbs);
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":bytes recv %Lu %Lu",
+            sp->is_cbr, sp->is_sbr);
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":time connected %Lu %Lu",
             sp->is_cti, sp->is_sti);
 }