| Commit message (Expand) | Author | Age | Files | Lines |
| * | 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 | -1/+1 |
| * | 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 | -0/+9 |
| * | 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 | -0/+1 |
| * | 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 | -4/+8 |
| * | 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.
| Ryan Schmidt | 2025-10-10 | 1 | -2/+3 |
| * | msgbuf: duplicate the string during partial parse and constify line | Raito Bezarius | 2025-10-10 | 1 | -1/+1 |
| * | 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/+6 |
| * | msgbuf: Add msgbuf_get_tag | Ed Kellett | 2025-10-10 | 1 | -0/+2 |
| * | Mailmap and copyright update for Ariadne | Ariadne Conill | 2021-06-01 | 1 | -1/+1 |
| * | Innovation by sed | Ed Kellett | 2020-10-15 | 1 | -3/+3 |
| * | m_alias: Preserve protocol framing characters | Ed Kellett | 2020-07-05 | 1 | -0/+7 |
| * | 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 | -1/+34 |
| * | msgbuf: correctly split buffers into IRCv3 tags and RFC1459 message data | Simon Arlott | 2017-07-29 | 1 | -13/+4 |
| * | msgbuf: remove unused field parselen | Simon Arlott | 2017-07-27 | 1 | -1/+0 |
| * | msgbuf: s_assert is not a substitute for proper code•••(dns, m_alias, m_stats updated as msgbuf no longer includes s_assert.h)
| Simon Arlott | 2017-07-26 | 1 | -12/+10 |
| * | msgbuf: allow for an explicit target to be defined | William Pitcock | 2016-02-20 | 1 | -2/+3 |
| * | msgbuf: make msgbuf_unparse_prefix() public | William Pitcock | 2016-02-20 | 1 | -0/+2 |
| * | msgbuf: add some message building code | William Pitcock | 2016-02-20 | 1 | -3/+3 |
| * | msgbuf: msgbuf_append_tag(): add support for attaching a specific capability bit | William Pitcock | 2016-02-13 | 1 | -1/+2 |
| * | msgbuf: pull in s_assert | William Pitcock | 2016-02-12 | 1 | -0/+2 |
| * | msgbuf: fix AFP() macro | William Pitcock | 2016-02-12 | 1 | -1/+1 |
| * | msgbuf: attach capabilities mask to each tag for sending•••this will be used with a bloom filter to speed up the 1-to-many case
| William Pitcock | 2016-02-11 | 1 | -12/+17 |
| * | msgbuf: improve parse logic | William Pitcock | 2016-02-10 | 1 | -3/+1 |
| * | msgbuf: implement msgbuf_parse() | William Pitcock | 2016-02-10 | 1 | -1/+1 |
| * | msgbuf: add lowlevel interface for building MsgBuf objects | William Pitcock | 2016-02-09 | 1 | -2/+33 |
| * | include: add msgbuf.h for future msgbuf api | William Pitcock | 2016-02-09 | 1 | -0/+60 |