1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-09 15:03:13 +02:00

Move cptr->count to cptr->local->identbufcnt since this only used by

the ident reading code nowadays, which obviously only happens for
locally connected users.
This commit is contained in:
Bram Matthys
2019-09-11 14:36:12 +02:00
parent d80e601760
commit e372e9118d
3 changed files with 9 additions and 13 deletions
+1 -5
View File
@@ -933,7 +933,6 @@ struct Client {
char info[REALLEN + 1]; /**< Additional client information text. For persons this is gecos/realname */
char id[IDLEN + 1]; /**< Unique ID: SID or UID */
Client *srvptr; /**< Server on where this client is connected to (can be &me) */
int count; /**< Amount of data in buffer */
char *ip; /**< IP address of user or server (never NULL) */
ModData moddata[MODDATA_MAX_CLIENT]; /**< Client attached module data, used by the ModData system */
};
@@ -985,12 +984,9 @@ struct LocalClient {
u_short sasl_cookie;
char *sni_servername; /**< Servername as sent by client during SNI (otherwise NULL) */
int cap_protocol; /**< CAP protocol in use. At least 300 for any CAP capable client. 302 for 3.2, etc.. */
int identbufcnt; /**< Counter for 'ident' reading code */
};
#define CLIENT_LOCAL_SIZE sizeof(Client)
#define CLIENT_REMOTE_SIZE offsetof(Client,count)
struct MessageTag {
MessageTag *prev, *next;
char *name;
+6 -6
View File
@@ -1648,15 +1648,15 @@ static void read_authports(int fd, int revents, void *userdata)
* Oh. this is needed because an authd reply may come back in more
* than 1 read! -avalon
*/
if ((len = READ_SOCK(cptr->local->authfd, cptr->local->buffer + cptr->count,
sizeof(cptr->local->buffer) - 1 - cptr->count)) >= 0)
if ((len = READ_SOCK(cptr->local->authfd, cptr->local->buffer + cptr->local->identbufcnt,
sizeof(cptr->local->buffer) - 1 - cptr->local->identbufcnt)) >= 0)
{
cptr->count += len;
cptr->local->buffer[cptr->count] = '\0';
cptr->local->identbufcnt += len;
cptr->local->buffer[cptr->local->identbufcnt] = '\0';
}
cptr->local->lasttime = TStime();
if ((len > 0) && (cptr->count != (sizeof(cptr->local->buffer) - 1)) &&
if ((len > 0) && (cptr->local->identbufcnt != (sizeof(cptr->local->buffer) - 1)) &&
(sscanf(cptr->local->buffer, "%hd , %hd : USERID : %*[^:]: %10s",
&remp, &locp, ruser) == 3))
{
@@ -1684,7 +1684,7 @@ static void read_authports(int fd, int revents, void *userdata)
fd_close(cptr->local->authfd);
--OpenFiles;
cptr->local->authfd = -1;
cptr->count = 0;
cptr->local->identbufcnt = 0;
ClearAuth(cptr);
if (!DoingDNS(cptr))
finish_auth(cptr);
+2 -2
View File
@@ -788,8 +788,8 @@ int stats_mem(Client *sptr, char *para)
}
}
}
lcm = lc * CLIENT_LOCAL_SIZE;
rcm = rc * CLIENT_REMOTE_SIZE;
lcm = lc * sizeof(Client)+sizeof(LocalClient);
rcm = rc * sizeof(Client);
for (chptr = channel; chptr; chptr = chptr->nextch)
{