2 # Parent d5b15de617d54c694b84bd32b96cdb5e88491a9f
4 diff -r d5b15de617d5 include/client.h
5 --- a/include/client.h Sun Jul 14 17:56:54 2013 +0100
6 +++ b/include/client.h Sun Jul 14 18:05:01 2013 +0100
8 server, XXX if this is a user */
9 time_t cli_firsttime; /**< time client was created */
10 time_t cli_lastnick; /**< TimeStamp on nick */
11 - int cli_marker; /**< /who processing marker */
12 + unsigned int cli_marker; /**< processing marker */
13 struct Flags cli_flags; /**< client flags */
14 unsigned int cli_hopcount; /**< number of servers to this 0 = local */
15 struct irc_in_addr cli_ip; /**< Real IP of client */
17 struct Connection** con_p);
18 extern void client_set_privs(struct Client *client, struct ConfItem *oper);
19 extern int client_report_privs(struct Client* to, struct Client* client);
20 +extern unsigned int get_client_marker(void);
22 #endif /* INCLUDED_client_h */
24 diff -r d5b15de617d5 ircd/client.c
25 --- a/ircd/client.c Sun Jul 14 17:56:54 2013 +0100
26 +++ b/ircd/client.c Sun Jul 14 18:05:01 2013 +0100
33 + * A little spin-marking utility to tell us which clients we have already
34 + * processed and which not
36 +unsigned int get_client_marker(void)
38 + static unsigned int marker = 0;
42 + struct Client *cptr;
43 + for (cptr=GlobalClientList;cptr;cptr=cli_next(cptr))
45 + cli_marker(cptr) = 0;
52 diff -r d5b15de617d5 ircd/m_who.c
53 --- a/ircd/m_who.c Sun Jul 14 17:56:54 2013 +0100
54 +++ b/ircd/m_who.c Sun Jul 14 18:05:01 2013 +0100
56 /* #include <assert.h> -- Now using assert in ircd_log.h */
61 - * A little spin-marking utility to tell us which clients we have already
62 - * processed and which not
64 -static int who_marker = 0;
65 -static void move_marker(void)
69 - struct Client *cptr = GlobalClientList;
72 - cli_marker(cptr) = 0;
73 - cptr = cli_next(cptr);
79 #define CheckMark(x, y) ((x == y) ? 0 : (x = y))
80 #define Process(cptr) CheckMark(cli_marker(cptr), who_marker)
83 char *p; /* Scratch char pointer */
84 char *qrt; /* Pointer to the query type */
85 static char mymask[512]; /* To save the mask before corrupting it */
86 + unsigned int who_marker; /* Used to mark clients we've touched */
88 /* Let's find where is our mask, and if actually contains something */
89 mask = ((parc > 1) ? parv[1] : 0);
91 counter = (2048 / (counter + 4));
92 if (mask && (strlen(mask) > 510))
95 + who_marker = get_client_marker();
96 commas = (mask && strchr(mask, ','));
98 /* First treat mask as a list of plain nicks/channels */