]> jfr.im git - solanum.git/commitdiff
Mark fake test clients, don't assert they're real
authorEd Kellett <redacted>
Sat, 31 Oct 2020 15:15:25 +0000 (15:15 +0000)
committerEd Kellett <redacted>
Sun, 1 Nov 2020 04:33:30 +0000 (04:33 +0000)
include/client.h
ircd/parse.c
tests/client_util.c

index 55b0086d749ab50aae03c4527a97c77dde51baf4..8df9431df65e82520b4d1ac838d53ee02d137ae2 100644 (file)
@@ -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 */
index c6155b6c1e2ae1fde67abb3e0a0e5950344d3444..a446c2a1b686645ee597175ac793d0666026a53f 100644 (file)
@@ -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;
 
index 0b30ca71a464e2cb9cfee6ffc6ad30b412eb157f..6df89a4ac8c15f29614c52d3d02f8b06b180a85e 100644 (file)
@@ -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));