X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/212380e3f42f585dc1ea927402252eb943f91f7b..9b1b4a972b71cf2f9ecf01d0d082a8ac1bd9caf4:/src/whowas.c diff --git a/src/whowas.c b/src/whowas.c index 01279f7..4e31df7 100644 --- a/src/whowas.c +++ b/src/whowas.c @@ -38,7 +38,7 @@ #include "s_user.h" #include "send.h" #include "s_conf.h" -#include "memory.h" +#include "scache.h" /* internally defined function */ static void add_whowas_to_clist(struct Whowas **, struct Whowas *); @@ -72,7 +72,7 @@ void add_history(struct Client *client_p, int online) del_whowas_from_list(&WHOWASHASH[who->hashv], who); } who->hashv = hash_whowas_name(client_p->name); - who->logoff = CurrentTime; + who->logoff = rb_current_time(); /* * NOTE: strcpy ok here, the sizes in the client struct MUST * match the sizes in the whowas struct @@ -86,7 +86,7 @@ void add_history(struct Client *client_p, int online) else who->sockhost[0] = '\0'; - who->servername = client_p->user->server; + who->servername = scache_get_name(client_p->servptr->serv->nameinfo); if(online) { @@ -118,7 +118,7 @@ struct Client *get_history(const char *nick, time_t timelimit) struct Whowas *temp; int blah; - timelimit = CurrentTime - timelimit; + timelimit = rb_current_time() - timelimit; blah = hash_whowas_name(nick); temp = WHOWASHASH[blah]; for (; temp; temp = temp->next) @@ -134,23 +134,8 @@ struct Client *get_history(const char *nick, time_t timelimit) void count_whowas_memory(size_t * wwu, size_t * wwum) { - struct Whowas *tmp; - int i; - size_t u = 0; - size_t um = 0; - - /* count the number of used whowas structs in 'u' */ - /* count up the memory used of whowas structs in um */ - - for (i = 0, tmp = &WHOWAS[0]; i < NICKNAMEHISTORYLENGTH; i++, tmp++) - if(tmp->hashv != -1) - { - u++; - um += sizeof(struct Whowas); - } - *wwu = u; - *wwum = um; - return; + *wwu = NICKNAMEHISTORYLENGTH; + *wwum = NICKNAMEHISTORYLENGTH * sizeof(struct Whowas); } void