| 1 |
|
/* |
| 2 |
|
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
| 3 |
|
* |
| 4 |
< |
* Copyright (c) 1997-2015 ircd-hybrid development team |
| 4 |
> |
* Copyright (c) 1997-2018 ircd-hybrid development team |
| 5 |
|
* |
| 6 |
|
* This program is free software; you can redistribute it and/or modify |
| 7 |
|
* it under the terms of the GNU General Public License as published by |
| 83 |
|
* For a small parser like this, this is a good compromise and does |
| 84 |
|
* make it somewhat faster. - Dianora |
| 85 |
|
*/ |
| 86 |
< |
#define MAXPTRLEN 32 |
| 86 |
> |
enum { MAXPTRLEN = 32 }; |
| 87 |
|
|
| 88 |
|
|
| 89 |
|
static struct MessageTree |
| 119 |
|
{ |
| 120 |
|
sendto_realops_flags(UMODE_DEBUG, L_ADMIN, SEND_NOTICE, |
| 121 |
|
"Unknown prefix (%s) from %s, Squitting %s", |
| 122 |
< |
lbuffer, get_client_name(client_p, SHOW_IP), lsender); |
| 122 |
> |
lbuffer, client_get_name(client_p, SHOW_IP), lsender); |
| 123 |
|
sendto_realops_flags(UMODE_DEBUG, L_OPER, SEND_NOTICE, |
| 124 |
|
"Unknown prefix (%s) from %s, Squitting %s", |
| 125 |
< |
lbuffer, client_p->name, lsender); |
| 125 |
> |
lbuffer, client_get_name(client_p, MASK_IP), lsender); |
| 126 |
|
sendto_one(client_p, ":%s SQUIT %s :(Unknown prefix (%s) from %s)", |
| 127 |
|
me.id, lsender, lbuffer, client_p->name); |
| 128 |
|
} |
| 294 |
|
sendto_realops_flags(UMODE_DEBUG, L_ADMIN, SEND_NOTICE, |
| 295 |
|
"Fake direction: dropped message from %s[%s] via %s", |
| 296 |
|
from->name, from->from->name, |
| 297 |
< |
get_client_name(client_p, SHOW_IP)); |
| 297 |
> |
client_get_name(client_p, SHOW_IP)); |
| 298 |
|
sendto_realops_flags(UMODE_DEBUG, L_OPER, SEND_NOTICE, |
| 299 |
|
"Fake direction: dropped message from %s[%s] via %s", |
| 300 |
|
from->name, from->from->name, |
| 301 |
< |
get_client_name(client_p, MASK_IP)); |
| 301 |
> |
client_get_name(client_p, MASK_IP)); |
| 302 |
|
return; |
| 303 |
|
} |
| 304 |
|
} |
| 333 |
|
} |
| 334 |
|
else |
| 335 |
|
{ |
| 336 |
– |
unsigned int length = 0; |
| 337 |
– |
|
| 336 |
|
if ((s = strchr(ch, ' '))) |
| 337 |
|
*s++ = '\0'; |
| 338 |
|
|
| 360 |
|
assert(message->cmd); |
| 361 |
|
|
| 362 |
|
paramcount = message->args_max; |
| 363 |
< |
length = bufend - ((s) ? s : ch); |
| 363 |
> |
|
| 364 |
> |
size_t length = bufend - ((s) ? s : ch); |
| 365 |
|
message->bytes += length; |
| 366 |
|
} |
| 367 |
|
|
| 463 |
|
*/ |
| 464 |
|
if ((ntree_p = mtree_p->pointers[*cmd & (MAXPTRLEN - 1)]) == NULL) |
| 465 |
|
{ |
| 466 |
< |
ntree_p = MyCalloc(sizeof(struct MessageTree)); |
| 466 |
> |
ntree_p = xcalloc(sizeof(*ntree_p)); |
| 467 |
|
mtree_p->pointers[*cmd & (MAXPTRLEN - 1)] = ntree_p; |
| 468 |
|
|
| 469 |
|
mtree_p->links++; /* Have new pointer, so up ref count */ |
| 521 |
|
{ |
| 522 |
|
mtree_p->pointers[*cmd & (MAXPTRLEN - 1)] = NULL; |
| 523 |
|
mtree_p->links--; |
| 524 |
< |
MyFree(ntree_p); |
| 524 |
> |
xfree(ntree_p); |
| 525 |
|
} |
| 526 |
|
} |
| 527 |
|
} |
| 557 |
|
void |
| 558 |
|
mod_add_cmd(struct Message *msg) |
| 559 |
|
{ |
| 560 |
< |
assert(msg && msg->cmd); |
| 560 |
> |
assert(msg); |
| 561 |
> |
assert(msg->cmd); |
| 562 |
|
|
| 563 |
|
/* Command already added? */ |
| 564 |
|
if (msg_tree_parse(msg->cmd)) |
| 576 |
|
void |
| 577 |
|
mod_del_cmd(struct Message *msg) |
| 578 |
|
{ |
| 579 |
< |
assert(msg && msg->cmd); |
| 579 |
> |
assert(msg); |
| 580 |
> |
assert(msg->cmd); |
| 581 |
|
|
| 582 |
|
if (!msg_tree_parse(msg->cmd)) |
| 583 |
|
return; |