| Commit message (Expand) | Author | Age | Files | Lines |
| * | Separate client vs server caps•••Instead of overloading the same field in a LocalUser, have separate
fields for client caps vs server caps. While only one of these will ever
be nonzero, it reduces error by making it explicit which set of caps is
being checked. IsCapable and friends have been split as well, to
IsClientCapable and IsServerCapable. Finally, both fields have been
updated to uint64_t (server caps were approaching the current limit) and
all APIs that reference caps updated to uint64_t as well (no more
signed/unsigned mismatches).
| Ryan Schmidt | 2026-03-17 | 1 | -6/+6 |
| * | Revert "msgbuf: duplicate the string during partial parse and constify line" ...•••This reverts commit 5b253939da8f6b0a44ce6787ed12e26450ac6a63 to fix a
memory leak:
```
==825564== 818 bytes in 4 blocks are definitely lost in loss record 616 of 648
==825564== at 0x4844818: malloc (vg_replace_malloc.c:446)
==825564== by 0x49CD7A9: strdup (strdup.c:42)
==825564== by 0x4888A2E: msgbuf_partial_parse (msgbuf.c:143)
==825564== by 0x489DA84: build_msgbuf (send.c:276)
==825564== by 0x489DA84: sendto_one_numeric (send.c:431)
==825564== by 0x48A3CD7: show_isupport (supported.c:181)
==825564== by 0x489A9F2: user_welcome (s_user.c:1433)
==825564== by 0x489B114: register_local_user (s_user.c:718)
==825564== by 0x488FC08: handle_command (parse.c:310)
==825564== by 0x488FC08: parse (parse.c:224)
==825564== by 0x488EEF8: parse_client_queued.part.0 (packet.c:67)
==825564== by 0x488F084: parse_client_queued (packet.c:49)
==825564== by 0x488F084: read_packet (packet.c:306)
==825564== by 0x4B3C47B: rb_select_epoll (epoll.c:199)
==825564== by 0x4B3716F: rb_select (commio.c:2038)
==825564==
[...]
==825564==
==825564== 3,012 bytes in 15 blocks are definitely lost in loss record 627 of 648
==825564== at 0x4844818: malloc (vg_replace_malloc.c:446)
==825564== by 0x49CD7A9: strdup (strdup.c:42)
==825564== by 0x4888A2E: msgbuf_partial_parse (msgbuf.c:143)
==825564== by 0x489D3CE: build_msgbuf (send.c:276)
==825564== by 0x489D3CE: sendto_realops_snomask (send.c:1431)
==825564== by 0x4887C0D: load_a_module (modules.c:712)
==825564== by 0x488801D: load_core_modules (modules.c:257)
==825564== by 0x488124A: solanum_main (ircd.c:664)
==825564== by 0x494DCA7: (below main) (libc_start_call_main.h:58)
``` | Val Lorentz | 2025-10-11 | 1 | -2/+2 |
| * | 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.
| Ryan Schmidt | 2025-10-10 | 1 | -5/+5 |
| * | 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().
| Ryan Schmidt | 2025-10-10 | 1 | -25/+25 |
| * | Update MsgBuf for better tags support•••Note: Future commits within this PR update call sites to leverage these
changes. I opted to keep each individual commit smaller to make them
easier to review in series.
When parsing a line into a MsgBuf, we now keep track of whether the
final parameter had a leading colon or not, so that we can roundtrip
unparse it with said colon even if the final parameter lacks a space or
otherwise doesn't require the leading colon. solanum sends multiple such
messages and clients may be coded to expect colons in various
situations, so adding this roundtrip support maintains backwards
compatibility for when all outbound messages get parsed into MsgBuf and
then unparsed before being sent off.
The MsgBuf cache now keeps track of two messages: one with a "local"
source and one with a "remote" source. Many send functions, e.g. the
sendto_channel family, use ids for the sender when sending remotely but
use the hostmask or server name for local sends. When forcing outbound
messages into a parse/unparse loop we can no longer just ad-hoc assemble
strings together like the current linebuf code does, so instead we cache
both variants to avoid needless string formatting operations in tight
send loops.
Unparsing tags from a MsgBuf now enforces that the server tags and
client tags portions do not exceed 4094 bytes each, and that server tags
always come before client tags. Excess data is truncated.
| Ryan Schmidt | 2025-10-10 | 1 | -88/+144 |
| * | fix: remove cruft and fix msgbuf_parse | Raito Bezarius | 2025-10-10 | 1 | -1/+1 |
| * | msgbuf: duplicate the string during partial parse and constify line | Raito Bezarius | 2025-10-10 | 1 | -2/+2 |
| * | message-tags: facility to manipulate client-tags•••It provides for hook facilities to client-only tags:
- messages can be dropped silently ;
- messages can be edited ;
- messages can be stripped from a client-only tag
| Raito Bezarius | 2025-10-10 | 1 | -0/+8 |
| * | msgbuf: Add msgbuf_get_tag | Ed Kellett | 2025-10-10 | 1 | -0/+13 |
| * | msgbuf: use only relevant caps for the cache key | Ed Kellett | 2021-06-13 | 1 | -0/+2 |
| * | msgbuf_cache_get: Don't create cycle when evicting | Ed Kellett | 2021-06-08 | 1 | -0/+4 |
| * | Mailmap and copyright update for Ariadne | Ariadne Conill | 2021-06-01 | 1 | -1/+1 |
| * | Innovation by sed | Ed Kellett | 2020-10-15 | 1 | -1/+1 |
| * | m_alias: Preserve protocol framing characters | Ed Kellett | 2020-07-05 | 1 | -0/+35 |
| * | ircd: send tags on every message•••Simplify linebuf by introducing fsnprint to manage a list of printfs.
Add a msgbuf unparse cache for send functions that loop.
| Simon Arlott | 2017-08-06 | 1 | -9/+131 |
| * | tests: add msgbuf_parse tests | Simon Arlott | 2017-07-29 | 1 | -1/+1 |
| * | msgbuf: correctly split buffers into IRCv3 tags and RFC1459 message data | Simon Arlott | 2017-07-29 | 1 | -71/+192 |
| * | librb: remove unnecessary NULL from the end of rb_string_to_array output | Simon Arlott | 2017-07-29 | 1 | -8/+4 |
| * | msgbuf: don't append a ';' unless there are existing tags•••When both account-tag and server-time are present but the client
doesn't have the first (i == 0) of these enabled. They will get
an erroneous ';' after the '@'.
Track whether or not there are tags present, and use this to
determine whether to add the ';' or not. Also remove the extra
function that loops over all of the tags by using this flag to
handle the case where there are no tags being written.
| Simon Arlott | 2016-12-04 | 1 | -18/+8 |
| * | msgbuf_parse: rb_string_to_array outputs to a MAXPARA+1 size array | Simon Arlott | 2016-10-22 | 1 | -1/+1 |
| * | msgbuf: Fix remote crash vulnerability due to malformed message tag.•••Fixes #218
Reported-by: ManiacTwister <github@s7t.de>
| Aaron Jones | 2016-09-11 | 1 | -0/+2 |
| * | More cleanup | Matt Ullman | 2016-03-23 | 1 | -11/+4 |
| * | Cleanup warnings | Matt Ullman | 2016-03-21 | 1 | -2/+0 |
| * | msgbuf: msgbuf_unparse_tags(): don't send a tags sigil unless tags will actua... | William Pitcock | 2016-02-20 | 1 | -0/+17 |
| * | msgbuf: allow for an explicit target to be defined | William Pitcock | 2016-02-20 | 1 | -0/+3 |
| * | send: implement partial support for outbound tags (enough for account-tag as ... | William Pitcock | 2016-02-20 | 1 | -1/+4 |
| * | msgbuf: make msgbuf_unparse_prefix() public | William Pitcock | 2016-02-20 | 1 | -1/+1 |
| * | msgbuf: implement msgbuf_vunparse_fmt() and friends | William Pitcock | 2016-02-20 | 1 | -0/+40 |
| * | msgbuf: handle me.name properly | William Pitcock | 2016-02-20 | 1 | -2/+3 |
| * | msgbuf: add some message building code | William Pitcock | 2016-02-20 | 1 | -0/+71 |
| * | msgbuf: msgbuf_append_tag(): add support for attaching a specific capability bit | William Pitcock | 2016-02-13 | 1 | -1/+1 |
| * | msgbuf: do a better job of handling gotchas with parsing tags | William Pitcock | 2016-02-10 | 1 | -5/+12 |
| * | msgbuf: improve parse logic | William Pitcock | 2016-02-10 | 1 | -5/+7 |
| * | msgbuf: implement msgbuf_parse() | William Pitcock | 2016-02-10 | 1 | -0/+104 |