87 |
|
|
88 |
|
if (!from) |
89 |
|
{ |
90 |
< |
client_p->from = client_p; /* 'from' of local client is self! */ |
91 |
< |
client_p->connection = mp_pool_get(connection_pool); |
92 |
< |
client_p->connection->since = CurrentTime; |
93 |
< |
client_p->connection->lasttime = CurrentTime; |
94 |
< |
client_p->connection->firsttime = CurrentTime; |
90 |
> |
client_p->from = client_p; /* 'from' of local client is self! */ |
91 |
> |
client_p->connection = mp_pool_get(connection_pool); |
92 |
> |
client_p->connection->since = CurrentTime; |
93 |
> |
client_p->connection->lasttime = CurrentTime; |
94 |
> |
client_p->connection->firsttime = CurrentTime; |
95 |
|
client_p->connection->registration = REG_INIT; |
96 |
|
|
97 |
|
/* as good a place as any... */ |
98 |
|
dlinkAdd(client_p, &client_p->connection->lclient_node, &unknown_list); |
99 |
|
} |
100 |
|
else |
101 |
< |
client_p->from = from; /* 'from' of local client is self! */ |
101 |
> |
client_p->from = from; |
102 |
|
|
103 |
|
client_p->idhnext = client_p; |
104 |
< |
client_p->hnext = client_p; |
104 |
> |
client_p->hnext = client_p; |
105 |
|
SetUnknown(client_p); |
106 |
|
strcpy(client_p->username, "unknown"); |
107 |
|
strcpy(client_p->account, "0"); |
125 |
|
assert(client_p->channel.head == NULL); |
126 |
|
assert(dlink_list_length(&client_p->channel) == 0); |
127 |
|
assert(dlink_list_length(&client_p->whowas) == 0); |
128 |
< |
assert(!IsServer(client_p) || client_p->serv); |
128 |
> |
assert(dlink_list_length(&client_p->svstags) == 0); |
129 |
|
|
130 |
|
MyFree(client_p->serv); |
131 |
|
MyFree(client_p->certfp); |
138 |
|
assert(IsClosing(client_p) && IsDead(client_p)); |
139 |
|
|
140 |
|
MyFree(client_p->connection->challenge_response); |
141 |
– |
MyFree(client_p->connection->challenge_operator); |
141 |
|
client_p->connection->challenge_response = NULL; |
142 |
+ |
MyFree(client_p->connection->challenge_operator); |
143 |
|
client_p->connection->challenge_operator = NULL; |
144 |
|
|
145 |
|
/* |
146 |
< |
* Clean up extra sockets from listen{} blocks which have been discarded. |
146 |
> |
* Clean up extra sockets from listen {} blocks which have been discarded. |
147 |
|
*/ |
148 |
|
if (client_p->connection->listener) |
149 |
|
{ |
160 |
|
mp_pool_release(client_p); |
161 |
|
} |
162 |
|
|
163 |
+ |
void |
164 |
+ |
client_attach_svstag(struct Client *client_p, unsigned int numeric, |
165 |
+ |
const char *umodes, const char *const tag) |
166 |
+ |
{ |
167 |
+ |
struct ServicesTag *svstag = NULL; |
168 |
+ |
const struct user_modes *tab = NULL; |
169 |
+ |
|
170 |
+ |
if (numeric >= ERR_LAST_ERR_MSG || *umodes != '+') |
171 |
+ |
return; |
172 |
+ |
|
173 |
+ |
svstag = MyCalloc(sizeof(*svstag)); |
174 |
+ |
svstag->numeric = numeric; |
175 |
+ |
svstag->tag = xstrdup(tag); |
176 |
+ |
|
177 |
+ |
for (const char *m = umodes + 1; *m; ++m) |
178 |
+ |
if ((tab = umode_map[(unsigned char)*m])) |
179 |
+ |
svstag->umodes |= tab->flag; |
180 |
+ |
|
181 |
+ |
if (numeric != RPL_WHOISOPERATOR) |
182 |
+ |
dlinkAddTail(svstag, &svstag->node, &client_p->svstags); |
183 |
+ |
else |
184 |
+ |
dlinkAdd(svstag, &svstag->node, &client_p->svstags); |
185 |
+ |
} |
186 |
+ |
|
187 |
+ |
void |
188 |
+ |
client_clear_svstags(struct Client *client_p) |
189 |
+ |
{ |
190 |
+ |
dlink_node *node = NULL, *node_next = NULL; |
191 |
+ |
|
192 |
+ |
DLINK_FOREACH_SAFE(node, node_next, client_p->svstags.head) |
193 |
+ |
{ |
194 |
+ |
struct ServicesTag *svstag = node->data; |
195 |
+ |
|
196 |
+ |
dlinkDelete(&svstag->node, &client_p->svstags); |
197 |
+ |
MyFree(svstag->tag); |
198 |
+ |
MyFree(svstag); |
199 |
+ |
} |
200 |
+ |
} |
201 |
+ |
|
202 |
|
/* check_pings_list() |
203 |
|
* |
204 |
|
* inputs - pointer to list to check |
783 |
|
free_list_task(source_p); |
784 |
|
|
785 |
|
watch_del_watch_list(source_p); |
786 |
+ |
client_clear_svstags(source_p); |
787 |
+ |
|
788 |
|
sendto_realops_flags(UMODE_CCONN, L_ALL, SEND_NOTICE, |
789 |
|
"Client exiting: %s (%s@%s) [%s] [%s]", |
790 |
|
source_p->name, source_p->username, source_p->host, comment, |
835 |
|
{ |
836 |
|
char splitstr[HOSTLEN + HOSTLEN + 2] = ""; |
837 |
|
|
838 |
< |
/* This shouldn't ever happen */ |
839 |
< |
assert(source_p->serv && source_p->servptr); |
838 |
> |
assert(source_p->serv); |
839 |
> |
assert(source_p->servptr); |
840 |
|
|
841 |
|
if (ConfigServerHide.hide_servers) |
842 |
|
/* |
866 |
|
source_p->connection->recv.bytes >> 10); |
867 |
|
ilog(LOG_TYPE_IRCD, "%s was connected for %d day%s, %2d:%02d:%02d. %llu/%llu sendK/recvK.", |
868 |
|
source_p->name, connected/86400, (connected/86400 == 1) ? "" : "s", |
869 |
< |
(connected % 86400) / 3600, (connected % 3600) / 60, connected % 60, |
870 |
< |
source_p->connection->send.bytes >> 10, |
871 |
< |
source_p->connection->recv.bytes >> 10); |
869 |
> |
(connected % 86400) / 3600, (connected % 3600) / 60, connected % 60, |
870 |
> |
source_p->connection->send.bytes >> 10, |
871 |
> |
source_p->connection->recv.bytes >> 10); |
872 |
|
} |
873 |
|
} |
874 |
|
else if (IsClient(source_p) && !HasFlag(source_p, FLAGS_KILLED)) |
1060 |
|
{ |
1061 |
|
dlink_node *node = NULL; |
1062 |
|
|
1063 |
+ |
if (HasFlag(source, FLAGS_SERVICE) || |
1064 |
+ |
(HasUMode(source, UMODE_OPER) && ConfigGeneral.opers_bypass_callerid)) |
1065 |
+ |
return 1; |
1066 |
+ |
|
1067 |
|
if (source == target || find_accept(source->name, source->username, |
1068 |
|
source->host, target, match)) |
1069 |
|
return 1; |
1092 |
|
} |
1093 |
|
|
1094 |
|
unsigned int |
1095 |
< |
idle_time_get(const struct Client *source_p, const struct Client *target_p) |
1095 |
> |
client_get_idle_time(const struct Client *source_p, |
1096 |
> |
const struct Client *target_p) |
1097 |
|
{ |
1098 |
|
unsigned int idle = 0; |
1099 |
|
unsigned int min_idle = 0; |