| 282 |
|
if (conf->until > CurrentTime) |
| 283 |
|
continue; |
| 284 |
|
|
| 285 |
< |
if (conf->class == NULL) |
| 286 |
< |
confrq = DEFAULT_CONNECTFREQUENCY; |
| 287 |
< |
else |
| 288 |
< |
{ |
| 289 |
< |
confrq = conf->class->con_freq; |
| 290 |
< |
if (confrq < MIN_CONN_FREQ) |
| 291 |
< |
confrq = MIN_CONN_FREQ; |
| 292 |
< |
} |
| 285 |
> |
assert(conf->class); |
| 286 |
> |
|
| 287 |
> |
confrq = conf->class->con_freq; |
| 288 |
> |
if (confrq < MIN_CONN_FREQ) |
| 289 |
> |
confrq = MIN_CONN_FREQ; |
| 290 |
|
|
| 291 |
|
conf->until = CurrentTime + confrq; |
| 292 |
|
|
| 436 |
|
void |
| 437 |
|
add_capability(const char *capab_name, int cap_flag, int add_to_default) |
| 438 |
|
{ |
| 439 |
< |
struct Capability *cap = MyMalloc(sizeof(*cap)); |
| 439 |
> |
struct Capability *cap = MyCalloc(sizeof(*cap)); |
| 440 |
|
|
| 441 |
|
cap->name = xstrdup(capab_name); |
| 442 |
|
cap->cap = cap_flag; |
| 510 |
|
void |
| 511 |
|
send_capabilities(struct Client *client_p, int cap_can_send) |
| 512 |
|
{ |
| 513 |
< |
char msgbuf[IRCD_BUFSIZE] = ""; |
| 514 |
< |
char *t = msgbuf; |
| 518 |
< |
int tl; |
| 519 |
< |
dlink_node *ptr = NULL; |
| 513 |
> |
char buf[IRCD_BUFSIZE] = ""; |
| 514 |
> |
const dlink_node *ptr = NULL; |
| 515 |
|
|
| 516 |
|
DLINK_FOREACH(ptr, cap_list.head) |
| 517 |
|
{ |
| 518 |
< |
struct Capability *cap = ptr->data; |
| 518 |
> |
const struct Capability *cap = ptr->data; |
| 519 |
|
|
| 520 |
|
if (cap->cap & (cap_can_send|default_server_capabs)) |
| 521 |
|
{ |
| 522 |
< |
tl = sprintf(t, "%s ", cap->name); |
| 523 |
< |
t += tl; |
| 522 |
> |
strlcat(buf, cap->name, sizeof(buf)); |
| 523 |
> |
if (ptr->next) |
| 524 |
> |
strlcat(buf, " ", sizeof(buf)); |
| 525 |
|
} |
| 526 |
|
} |
| 527 |
|
|
| 528 |
< |
*(t - 1) = '\0'; |
| 533 |
< |
sendto_one(client_p, "CAPAB :%s", msgbuf); |
| 528 |
> |
sendto_one(client_p, "CAPAB :%s", buf); |
| 529 |
|
} |
| 530 |
|
|
| 531 |
|
/* |
| 568 |
|
make_server(struct Client *client_p) |
| 569 |
|
{ |
| 570 |
|
if (client_p->serv == NULL) |
| 571 |
< |
client_p->serv = MyMalloc(sizeof(struct Server)); |
| 571 |
> |
client_p->serv = MyCalloc(sizeof(struct Server)); |
| 572 |
|
|
| 573 |
|
return client_p->serv; |
| 574 |
|
} |
| 874 |
|
|
| 875 |
|
if (X509_digest(cert, EVP_sha256(), md, &n)) |
| 876 |
|
{ |
| 877 |
< |
for (unsigned int i = 0; i < n; ++i) |
| 883 |
< |
snprintf(buf + 2 * i, 3, "%02X", md[i]); |
| 877 |
> |
binary_to_hex(md, buf, n); |
| 878 |
|
client_p->certfp = xstrdup(buf); |
| 879 |
|
} |
| 880 |
|
} |