From 36a86e7290a0a9e7fd304587dcd91b11c3afdd65 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 1 Apr 2005 23:42:40 +0000 Subject: Massive stats L speedup git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@948 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index d2a187ac7..d3fcfa2df 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -201,7 +201,6 @@ long MyKey = C.GenKey(); int has_channel(userrec *u, chanrec *c); int usercount(chanrec *c); int usercount_i(chanrec *c); -void update_stats_l(int fd,int data_out); char* Passwd(userrec *user); bool IsDenied(userrec *user); void AddWhoWas(userrec* u); @@ -471,7 +470,6 @@ void Write(int sock,char *text, ...) if (sock != -1) { write(sock,tb,strlen(tb)); - update_stats_l(sock,strlen(tb)); /* add one line-out to stats L for this fd */ } } @@ -495,7 +493,6 @@ void WriteServ(int sock, char* text, ...) if (sock != -1) { write(sock,tb,strlen(tb)); - update_stats_l(sock,strlen(tb)); /* add one line-out to stats L for this fd */ } } @@ -519,7 +516,6 @@ void WriteFrom(int sock, userrec *user,char* text, ...) if (sock != -1) { write(sock,tb,strlen(tb)); - update_stats_l(sock,strlen(tb)); /* add one line-out to stats L for this fd */ } } @@ -1067,22 +1063,6 @@ userrec* Find(std::string nick) return iter->second; } -void update_stats_l(int fd,int data_out) /* add one line-out to stats L for this fd */ -{ - for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) - { - if (i->second) - { - if (i->second->fd == fd) - { - i->second->bytes_out+=data_out; - i->second->cmds_out++; - } - } - } -} - - /* find a channel record by channel name and return a pointer to it */ chanrec* FindChan(const char* chan) @@ -2913,6 +2893,8 @@ void process_command(userrec *user, char* cmd) { user->bytes_in += strlen(temp); user->cmds_in++; + user->bytes_out+=strlen(temp); + user->cmds_out++; } cmdlist[i].use_count++; cmdlist[i].total_bytes+=strlen(temp); -- cgit v1.2.3