diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-01 23:42:40 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-01 23:42:40 +0000 |
commit | 36a86e7290a0a9e7fd304587dcd91b11c3afdd65 (patch) | |
tree | bbde73014c6e40fd7a05caef267c418b7c18bafc /src | |
parent | 83a55a9d26af3772b5613e2cca7e540183f3ea62 (diff) |
Massive stats L speedup
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@948 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 22 |
1 files 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); |