]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
make is_cti/is_sti collect times connected in unsigned long long instead of time_t...
authorAaron Sethman <redacted>
Sun, 16 Nov 2008 07:04:09 +0000 (10:04 +0300)
committerAaron Sethman <redacted>
Sun, 16 Nov 2008 07:04:09 +0000 (10:04 +0300)
committer: Valeriy Yatsko <redacted>

include/s_stats.h
modules/m_stats.c
src/client.c

index 797b32ff09101cf07a874469369cf9371ce4aceb..ef9a8c30ad5c33bbf83478921623f7e0b78dd62a 100644 (file)
@@ -49,8 +49,8 @@ struct ServerStatistics
        unsigned long long int is_cbr;  /* bytes received to clients */
        unsigned long long int is_sbs;  /* bytes sent to servers */
        unsigned long long int is_sbr;  /* bytes received to servers */
-       time_t is_cti;          /* time spent connected by clients */
-       time_t is_sti;          /* time spent connected by servers */
+       unsigned long long int is_cti;  /* time spent connected by clients */
+       unsigned long long int is_sti;  /* time spent connected by servers */
        unsigned int is_ac;     /* connections accepted */
        unsigned int is_ref;    /* accepts refused */
        unsigned int is_unco;   /* unknown commands */
index b1c68ec0a2589b6fab8b9e90f68154a4c97e3768..b779b96db404e5f2828b82c8598786684a1bdeca 100644 (file)
@@ -852,7 +852,7 @@ stats_tstats (struct Client *source_p)
 
                sp.is_sbs += target_p->localClient->sendB;
                sp.is_sbr += target_p->localClient->receiveB;
-               sp.is_sti += rb_current_time() - target_p->localClient->firsttime;
+               sp.is_sti += (unsigned long long)(rb_current_time() - target_p->localClient->firsttime);
                sp.is_sv++;
        }
 
@@ -862,7 +862,7 @@ stats_tstats (struct Client *source_p)
 
                sp.is_cbs += target_p->localClient->sendB;
                sp.is_cbr += target_p->localClient->receiveB;
-               sp.is_cti += rb_current_time() - target_p->localClient->firsttime;
+               sp.is_cti += (unsigned long long)(rb_current_time() - target_p->localClient->firsttime);
                sp.is_cl++;
        }
 
@@ -911,8 +911,8 @@ stats_tstats (struct Client *source_p)
                                sp.is_cbr / 1024, 
                                sp.is_sbr / 1024);
        sendto_one_numeric(source_p, RPL_STATSDEBUG,
-                               "T :time connected %lu %lu",
-                               (long int)sp.is_cti, (long int)sp.is_sti);
+                               "T :time connected %llu %llu",
+                               sp.is_cti, sp.is_sti);
 }
 
 static void
index 7573a6f8f2f0ae29f5fc5379848c5f7f6259867e..458247b9e594cddc6af88ecd333e498efef16423 100644 (file)
@@ -1882,7 +1882,7 @@ close_connection(struct Client *client_p)
                ServerStats.is_sv++;
                ServerStats.is_sbs += client_p->localClient->sendB;
                ServerStats.is_sbr += client_p->localClient->receiveB;
-               ServerStats.is_sti += rb_current_time() - client_p->localClient->firsttime;
+               ServerStats.is_sti += (unsigned long long)(rb_current_time() - client_p->localClient->firsttime);
 
                /*
                 * If the connection has been up for a long amount of time, schedule
@@ -1908,7 +1908,7 @@ close_connection(struct Client *client_p)
                ServerStats.is_cl++;
                ServerStats.is_cbs += client_p->localClient->sendB;
                ServerStats.is_cbr += client_p->localClient->receiveB;
-               ServerStats.is_cti += rb_current_time() - client_p->localClient->firsttime;
+               ServerStats.is_cti += (unsigned long long)(rb_current_time() - client_p->localClient->firsttime);
        }
        else
                ServerStats.is_ni++;