From 5409fbc0f731a04066c9d6a741e0b8d8eb098d8a Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Sat, 31 Oct 2020 15:15:25 +0000 Subject: [PATCH] Mark fake test clients, don't assert they're real --- include/client.h | 1 + ircd/parse.c | 5 +++-- tests/client_util.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/client.h b/include/client.h index 55b0086d..8df9431d 100644 --- a/include/client.h +++ b/include/client.h @@ -438,6 +438,7 @@ struct ListClient #define LFLAGS_CORK 0x00000004 #define LFLAGS_SCTP 0x00000008 #define LFLAGS_SECURE 0x00000010 /* for marking SSL clients as secure before registration */ +#define LFLAGS_FAKE 0x00000020 /* umodes, settable flags */ /* lots of this moved to snomask -- jilles */ diff --git a/ircd/parse.c b/ircd/parse.c index c6155b6c..a446c2a1 100644 --- a/ircd/parse.c +++ b/ircd/parse.c @@ -82,8 +82,9 @@ parse(struct Client *client_p, char *pbuffer, char *bufend) struct Message *mptr; struct MsgBuf msgbuf; - s_assert(MyConnect(client_p)); - s_assert(client_p->localClient->F != NULL); + s_assert(MyConnect(client_p) && + (client_p->localClient->F != NULL || + client_p->localClient->localflags & LFLAGS_FAKE)); if(IsAnyDead(client_p)) return; diff --git a/tests/client_util.c b/tests/client_util.c index 0b30ca71..6df89a4a 100644 --- a/tests/client_util.c +++ b/tests/client_util.c @@ -59,6 +59,7 @@ struct Client *make_local_unknown(void) rb_dlinkAdd(client, &client->lnode, &client->servptr->serv->users); client->localClient->listener = &fake_listener; client->preClient->auth.accepted = true; + client->localClient->localflags |= LFLAGS_FAKE; return client; } @@ -123,6 +124,7 @@ struct Client *make_remote_server_full(struct Client *uplink, const char *name, client = make_client(NULL); client->servptr = uplink; + client->localClient->localflags |= LFLAGS_FAKE; attach_server_conf(client, find_server_conf(name));