m_stats.c fixed not to use kb in tstats output

This commit is contained in:
Valery Yatsko 2008-04-08 18:05:29 +04:00
parent 29c8637abb
commit 477035a4d2
1 changed files with 29 additions and 54 deletions

View File

@ -940,20 +940,8 @@ stats_tstats (struct Client *source_p)
sp.is_sbs += target_p->localClient->sendB; sp.is_sbs += target_p->localClient->sendB;
sp.is_sbr += target_p->localClient->receiveB; sp.is_sbr += target_p->localClient->receiveB;
sp.is_sks += target_p->localClient->sendK;
sp.is_skr += target_p->localClient->receiveK;
sp.is_sti += rb_current_time() - target_p->localClient->firsttime; sp.is_sti += rb_current_time() - target_p->localClient->firsttime;
sp.is_sv++; 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;
}
} }
RB_DLINK_FOREACH(ptr, lclient_list.head) RB_DLINK_FOREACH(ptr, lclient_list.head)
@ -962,21 +950,8 @@ stats_tstats (struct Client *source_p)
sp.is_cbs += target_p->localClient->sendB; sp.is_cbs += target_p->localClient->sendB;
sp.is_cbr += target_p->localClient->receiveB; sp.is_cbr += target_p->localClient->receiveB;
sp.is_cks += target_p->localClient->sendK;
sp.is_ckr += target_p->localClient->receiveK;
sp.is_cti += rb_current_time() - target_p->localClient->firsttime; sp.is_cti += rb_current_time() - target_p->localClient->firsttime;
sp.is_cl++; 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;
}
} }
RB_DLINK_FOREACH(ptr, unknown_list.head) RB_DLINK_FOREACH(ptr, unknown_list.head)
@ -1016,16 +991,16 @@ stats_tstats (struct Client *source_p)
sendto_one_numeric(source_p, RPL_STATSDEBUG, sendto_one_numeric(source_p, RPL_STATSDEBUG,
"T :connected %u %u", sp.is_cl, sp.is_sv); "T :connected %u %u", sp.is_cl, sp.is_sv);
sendto_one_numeric(source_p, RPL_STATSDEBUG, sendto_one_numeric(source_p, RPL_STATSDEBUG,
"T :bytes sent %d.%uK %d.%uK", "T :bytes sent %lluK %lluK",
(int) sp.is_cks, sp.is_cbs, sp.is_cbs / 1024,
(int) sp.is_sks, sp.is_sbs); sp.is_sbs / 1024);
sendto_one_numeric(source_p, RPL_STATSDEBUG, sendto_one_numeric(source_p, RPL_STATSDEBUG,
"T :bytes recv %d.%uK %d.%uK", "T :bytes recv %lluK %lluK",
(int) sp.is_ckr, sp.is_cbr, sp.is_cbr / 1024,
(int) sp.is_skr, sp.is_sbr); sp.is_sbr / 1024);
sendto_one_numeric(source_p, RPL_STATSDEBUG, sendto_one_numeric(source_p, RPL_STATSDEBUG,
"T :time connected %d %d", "T :time connected %lu %lu",
(int) sp.is_cti, (int) sp.is_sti); sp.is_cti, sp.is_sti);
} }
static void static void