struct ZipStats
{
- unsigned long in;
- unsigned long in_wire;
- unsigned long out;
- unsigned long out_wire;
- unsigned long inK;
- unsigned long inK_wire;
- unsigned long outK;
- unsigned long outK_wire;
- double in_ratio;
+ unsigned long long in;\r
+ unsigned long long in_wire;\r
+ unsigned long long out;\r
+ unsigned long long out_wire;\r
+ double in_ratio;\r
double out_ratio;
};
unsigned int is_cl; /* number of client connections */
unsigned int is_sv; /* number of server connections */
unsigned int is_ni; /* connection but no idea who it was */
- unsigned short is_cbs; /* bytes sent to clients */
- unsigned short is_cbr; /* bytes received to clients */
- unsigned short is_sbs; /* bytes sent to servers */
- unsigned short is_sbr; /* bytes received to servers */
- unsigned long is_cks; /* k-bytes sent to clients */
- unsigned long is_ckr; /* k-bytes received to clients */
- unsigned long is_sks; /* k-bytes sent to servers */
- unsigned long is_skr; /* k-bytes received to servers */
+ unsigned long long int is_cbs; /* bytes sent to clients */\r
+ unsigned long long int is_cbr; /* bytes received to clients */\r
+ unsigned long long int is_sbs; /* bytes sent to servers */\r
+ 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 int is_ac; /* connections accepted */
{
rb_dlink_node *ptr;
struct Client *target_p;
+ struct ZipStats *zipstats;
int sent_data = 0;
char buf[128], buf1[128];
-
RB_DLINK_FOREACH (ptr, serv_list.head)
{
target_p = ptr->data;
if(IsCapable (target_p, CAP_ZIP))
{
- /* we use memcpy(3) and a local copy of the structure to
- * work around a register use bug on GCC on the SPARC.
- * -jmallett, 04/27/2002
- */
- struct ZipStats zipstats;
- memcpy (&zipstats, &target_p->localClient->zipstats,
- sizeof (struct ZipStats));
- snprintf(buf, sizeof buf, "%.2f%%", zipstats.out_ratio);
- snprintf(buf1, sizeof buf1, "%.2f%%", zipstats.in_ratio);
-
+ zipstats = target_p->localClient->zipstats;
+ sprintf(buf, "%.2f%%", zipstats->out_ratio);
+ sprintf(buf1, "%.2f%%", zipstats->in_ratio);
sendto_one_numeric(source_p, RPL_STATSDEBUG,
"Z :ZipLinks stats for %s send[%s compression "
- "(%lu kB data/%lu kB wire)] recv[%s compression "
- "(%lu kB data/%lu kB wire)]",
+ "(%llu kB data/%llu kB wire)] recv[%s compression "
+ "(%llu kB data/%llu kB wire)]",
target_p->name,
- buf, zipstats.outK, zipstats.outK_wire,
- buf1, zipstats.inK, zipstats.inK_wire);
+ buf, zipstats->out >> 10,
+ zipstats->out_wire >> 10, buf1,
+ zipstats->in >> 10, zipstats->in_wire >> 10);
sent_data++;
}
}
{
struct server_conf *server_p;
- ServerStats.is_sv++;
- ServerStats.is_sbs += client_p->localClient->sendB;
- ServerStats.is_sbr += client_p->localClient->receiveB;
- ServerStats.is_sks += client_p->localClient->sendK;
- ServerStats.is_skr += client_p->localClient->receiveK;
+ ServerStats.is_sv++;\r
+ ServerStats.is_sbs += client_p->localClient->sendB;\r
+ ServerStats.is_sbr += client_p->localClient->receiveB;\r
ServerStats.is_sti += rb_current_time() - client_p->localClient->firsttime;
- if(ServerStats.is_sbs > 2047)
- {
- ServerStats.is_sks += (ServerStats.is_sbs >> 10);
- ServerStats.is_sbs &= 0x3ff;
- }
- if(ServerStats.is_sbr > 2047)
- {
- ServerStats.is_skr += (ServerStats.is_sbr >> 10);
- ServerStats.is_sbr &= 0x3ff;
- }
/*
* If the connection has been up for a long amount of time, schedule
}
else if(IsClient(client_p))
{
- ServerStats.is_cl++;
- ServerStats.is_cbs += client_p->localClient->sendB;
- ServerStats.is_cbr += client_p->localClient->receiveB;
- ServerStats.is_cks += client_p->localClient->sendK;
- ServerStats.is_ckr += client_p->localClient->receiveK;
+ ServerStats.is_cl++;\r
+ ServerStats.is_cbs += client_p->localClient->sendB;\r
+ ServerStats.is_cbr += client_p->localClient->receiveB;\r
ServerStats.is_cti += rb_current_time() - client_p->localClient->firsttime;
- if(ServerStats.is_cbs > 2047)
- {
- ServerStats.is_cks += (ServerStats.is_cbs >> 10);
- ServerStats.is_cbs &= 0x3ff;
- }
- if(ServerStats.is_cbr > 2047)
- {
- ServerStats.is_ckr += (ServerStats.is_cbr >> 10);
- ServerStats.is_cbr &= 0x3ff;
- }
}
else
ServerStats.is_ni++;