diff --git a/include/s_stats.h b/include/s_stats.h index 797b32f..ef9a8c3 100644 --- a/include/s_stats.h +++ b/include/s_stats.h @@ -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 */ diff --git a/modules/m_stats.c b/modules/m_stats.c index b1c68ec..b779b96 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -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 diff --git a/src/client.c b/src/client.c index 7573a6f..458247b 100644 --- a/src/client.c +++ b/src/client.c @@ -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++;