53 |
|
{ |
54 |
|
struct Whowas *who = &WHOWAS[whowas_next]; |
55 |
|
|
56 |
< |
assert(client_p != NULL); |
57 |
< |
|
58 |
< |
if (client_p == NULL) |
59 |
< |
return; |
60 |
< |
|
61 |
< |
/* XXX when is this possible? Looks like it could happen |
62 |
< |
* (with a half registered client.) |
63 |
< |
* and what is the correct action here? - Dianora |
64 |
< |
*/ |
65 |
< |
if (client_p->servptr == NULL) |
66 |
< |
return; |
56 |
> |
assert(client_p && client_p->servptr); |
57 |
|
|
58 |
|
if (who->hashv != -1) |
59 |
|
{ |
62 |
|
del_whowas_from_list(&WHOWASHASH[who->hashv], who); |
63 |
|
} |
64 |
|
|
65 |
< |
who->hashv = strhash(client_p->name); |
65 |
> |
who->hashv = strhash(client_p->name); |
66 |
|
who->logoff = CurrentTime; |
67 |
|
|
68 |
|
/* NOTE: strcpy ok here, the sizes in the client struct MUST |
124 |
|
} |
125 |
|
|
126 |
|
void |
127 |
< |
count_whowas_memory(int *wwu, unsigned long *wwum) |
127 |
> |
count_whowas_memory(unsigned int *wwu, uint64_t *wwum) |
128 |
|
{ |
129 |
< |
struct Whowas *tmp; |
129 |
> |
const struct Whowas *tmp; |
130 |
|
int i; |
131 |
< |
int u = 0; |
132 |
< |
unsigned long um = 0; |
131 |
> |
unsigned int u = 0; |
132 |
> |
uint64_t um = 0; |
133 |
|
|
134 |
|
/* count the number of used whowas structs in 'u' */ |
135 |
|
/* count up the memory used of whowas structs in um */ |
136 |
< |
for (i = 0, tmp = &WHOWAS[0]; i < NICKNAMEHISTORYLENGTH; i++, tmp++) |
136 |
> |
for (i = 0, tmp = &WHOWAS[0]; i < NICKNAMEHISTORYLENGTH; ++i, ++tmp) |
137 |
|
{ |
138 |
|
if (tmp->hashv != -1) |
139 |
|
{ |
140 |
< |
u++; |
140 |
> |
++u; |
141 |
|
um += sizeof(struct Whowas); |
142 |
|
} |
143 |
|
} |