From 612988aeb323df99c68c3082384b2bdd39e7eb86 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 25 Jan 2014 23:14:19 +0000 Subject: - s_auth.c, s_auth.h: optimized so we save unecessary auth_doing_list traversals. Patch provided by Adam. git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2930 82007160-df01-0410-b94d-b575c5fd34c7 --- include/s_auth.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/s_auth.h b/include/s_auth.h index dcac37b..f2b256a 100644 --- a/include/s_auth.h +++ b/include/s_auth.h @@ -27,12 +27,16 @@ #ifndef INCLUDED_s_auth_h #define INCLUDED_s_auth_h -/* - * flag values for AuthRequest - * NAMESPACE: AM_xxx - Authentication Module - */ -#define AM_DOING_AUTH 0x1 -#define AM_DNS_PENDING 0x2 +enum +{ + AM_IN_AUTH = 1 << 0, + AM_DOING_AUTH = 1 << 1, + AM_DNS_PENDING = 1 << 2 +}; + +#define SetInAuth(x) ((x)->flags |= AM_IN_AUTH) +#define ClearInAuth(x) ((x)->flags &= ~AM_IN_AUTH) +#define IsInAuth(x) ((x)->flags & AM_IN_AUTH) #define SetDNSPending(x) ((x)->flags |= AM_DNS_PENDING) #define ClearDNSPending(x) ((x)->flags &= ~AM_DNS_PENDING) -- cgit