aboutsummaryrefslogtreecommitdiffstats
path: root/ircd/parse.c
Commit message (Expand)AuthorAgeFilesLines
* parse: fix crash•••The incoming_client and incoming_message globals were not properly cleared after processing a numeric command. Ensure they are cleared by not returning early after setting those global values. Fixes: e2a499fGravatar Ryan Schmidt2026-01-271-3/+3
* Add batch support•••- Add "batch" client capability - Support sending netsplit/netjoin batches - Support receiving BATCH from clients and remote servers - Support for modules to define supported batch types for incoming batches - Add "message_handler" hook to override the handler for a particular incoming message - Add technical and user-facing documentation for batches - Add some more sendto_* overloads that support tags which were missing from the initial message-tags implementation but turned out to be needed Gravatar Ryan Schmidt2026-01-211-0/+5
* Propagate tags in numerics from linked servers (#477)•••Previously, we handled numerics before running the message_tags hook or setting the incoming_message and incoming_client globals, which meant that tags received from linked servers would never be passed along to clients. Now do both of those things before passing the numeric along so we can propagate message tags in numerics. This will, among other things, mean server-time now works with numerics and solves an issue with implementing labeled-response in the future.Gravatar Ryan Schmidt2026-01-111-20/+18
* Ensure duplicate tags only use the final value•••Per spec, individual tag keys MUST only be used once per message, and implementations SHOULD disregard all but the final occurrence of a tag key. As such, iterate over the user-provided tags in reverse order and automatically discard tags that we have already approved. Also, require that a client giving us a +typing tag has negotiated the message-tags capability themselves. Gravatar Ryan Schmidt2025-10-101-2/+7
* Fix typing module decl and send 417 in more cases•••The typing module declaration had a copy/paste error that has now been corrected, and we now send 417 ERR_INPUTTOOLONG in cases where parsing the line into a MsgBuf fails because it overflowed the 8191+512 byte buffer while processing tags or the message origin. Gravatar Ryan Schmidt2025-10-101-0/+3
* Address review comments•••Correctly sent ERR_INPUTTOOLONG if the incoming tags portion from a client is too long. The previous calculation did not take into account the fact we added null terminators after every tag key and value. Since msgbuf_parse is used for both server and client input, we expose the length of the original tags portion of the buffer in the MsgBuf struct rather than abort msgbuf_parse if it is too long, since the only time truncation is explicitly not allowed is for incoming tags from client messages. Additionally, make join_sep functional in format_client_tags(). Gravatar Ryan Schmidt2025-10-101-1/+1
* Refactor message_tag hook•••The original hook was defined in the (now-removed) cap_message_tag module. This new hook lives deeper down in parse.c so that it fires on all incoming tags for all incoming messages. The hook was renamed from client_tag_accept to message_tag to denote that it is used for all tags, including tags coming from server connections, and not just tags with a client-only prefix. The hook data contains two non-const fields for the capmask and approval status. Since incoming tags lack a capmask entirely, this allows hook functions that wish to keep the tag around to specify the capmask used for propagating the tag to other clients and servers. The approval status can take one of three forms: approve the tag, drop the tag from the message (but still process other tags and run the command handler), or drop the entire message (not processing any other tags and not running any command handlers). It is expected when a hook function drops the message that they'll send appropriate feedback to the client, however the nature of that feedback will likely vary by hook function so no default message is given to a client if their message is dropped. The incoming_message global defined previously with cap_server_time now holds the MsgBuf with the updated/sanitized list of tags rather than the raw values specified by the client. Additionally, cap_server_time makes use of this new hook to propagate the time tag into function callbacks that support tag propagation. The implicit propagation still exists since the majority of function callbacks do not support explicit tag propagation, and that fact will not change in the course of this patchset. Gravatar Ryan Schmidt2025-10-101-2/+49
* Increase tags to 8191 bytes and max count to 30•••If we receive an incoming message from a client that has over 4094 bytes of tag data (not including leading '@' or trailing ' '), reject the message with ERR_INPUTTOOLONG (417) per the message-tags spec. Similarly, give the same numeric if the client specifies the new maximum of 30 tags, since we can't distinguish between a client that gives us 30 tags and one that gives us more than 30. The spec says we are not allowed to truncate tags at all, and having 30 means we could have potentially truncated the incoming tag data. Gravatar Ryan Schmidt2025-10-101-0/+7
* Propagate server-time implicitly (ugh)Gravatar Ed Kellett2025-10-101-0/+8
* Mailmap and copyright update for AriadneGravatar Ariadne Conill2021-06-011-1/+1
* make more snotes L_NETWIDEGravatar jess2020-11-081-4/+4
* Mark fake test clients, don't assert they're realGravatar Ed Kellett2020-11-011-2/+3
* Innovation by sedGravatar Ed Kellett2020-10-151-1/+1
* ircd: log command in mod_add_cmd/mod_del_cmd error scenariosGravatar Simon Arlott2017-08-051-1/+4
* msgbuf: remove unused field parselenGravatar Simon Arlott2017-07-271-2/+0
* ircd: don't send ERR_NOTREGISTERED to servers•••Sending messages after SERVER but before zlib is established breaks outgoing connections. If the other server is misbehaving then ignore its messages. Gravatar Simon Arlott2016-04-241-0/+3
* ircd: parse: add asserts for improper use of mod_add_cmd/mod_del_cmdGravatar Simon Arlott2016-04-231-2/+5
* Move alias handling into a dedicated module.•••Not yet tested, caveat emptor! Closes #166 Gravatar Elizabeth Myers2016-04-061-66/+0
* Use rb_* versions of nonportable string functionsGravatar Elizabeth Myers2016-04-051-1/+1
* common.h: raison d'ĂȘtre is gone, so out it goes.•••Fold whatever was left into ircd_defs.h Gravatar Elizabeth Myers2016-03-231-1/+0
* Change struct Dictionary(*) to rb_dictionary(_\1).•••This cleans things up a slightly and puts the dictionary stuff in its own namespace. Gravatar Elizabeth Myers2016-03-231-2/+2
* More cleanupGravatar Matt Ullman2016-03-231-4/+4
* Cleanup warningsGravatar Matt Ullman2016-03-211-4/+1
* parse: check IsServer() before firing off a remove_unknowns() callGravatar William Pitcock2016-03-201-1/+1
* ircd: parse: now this type cast for POINTER MATH is just fucking stupidGravatar William Pitcock2016-03-201-1/+1
* parse: ensure that aliases have a sufficient number of parameters before tryi...Gravatar William Pitcock2016-03-171-0/+9
* Message handlers should return void.•••Also fix up some return values and stuff to use bool (or void if nothing). I just did it whilst I was here. According to jilles, the return value used to signify whether or not the client had exited. This was error-prone and was fixed a long, long time ago, but the return value was left int for historical reasons. Since the return type is not used (and has no clear use case anyway), it's safe to just get rid of it. Gravatar Elizabeth Myers2016-03-091-9/+5
* Move irc_* data structures to librb.•••This makes the base ircd less cluttered up with data structures that can go elsewhere. Gravatar Elizabeth Myers2016-03-061-7/+7
* Remove $Id tags from everything.•••These are obsolete and none have changed since 10 years gao... Gravatar Elizabeth Myers2016-03-061-3/+0
* parse: export cmd_dict for use elsewhere.Gravatar Elizabeth Myers2016-03-051-1/+1
* parse: get rid of report_messages•••It is a function with a single usage, that is used only for one specific stats command on one line. Gravatar Elizabeth Myers2016-03-051-32/+0
* msg: remove last vestiges of the fakelag system. charybdis has never support...Gravatar William Pitcock2016-02-191-13/+0
* ircd: change MessageHandler to include a MsgBuf pointer at the front for tag ...Gravatar William Pitcock2016-02-101-21/+19
* parse: further cleanupsGravatar William Pitcock2016-02-101-7/+4
* parse: fix aliasesGravatar William Pitcock2016-02-101-2/+2
* parse: utilise MsgBuf to simplify message parsingGravatar William Pitcock2016-02-101-163/+55
* Remove libratbox's snprintf.c, update related ircd codeGravatar Valerii Iatsko2016-02-101-3/+3
* parse: implement reconstruct_parv()Gravatar William Pitcock2016-01-111-0/+12
* ircd: ensure irc_dictionary users have names, for stats tracking.Gravatar William Pitcock2016-01-091-1/+1
* rename src to ircd, libcore to libircdGravatar William Pitcock2016-01-061-0/+754