Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add an API to send client batches #106

Open
slingamn opened this issue Jun 11, 2024 · 0 comments
Open

add an API to send client batches #106

slingamn opened this issue Jun 11, 2024 · 0 comments

Comments

@slingamn
Copy link
Member

https://ircv3.net/specs/extensions/client-batch says:

Once a client has opened a batch, it MUST NOT send any messages that are not part of the batch, until it is closed (with BATCH -reference-tag).

so there is no way to send these safely with the current API; all the (*Connection).Send methods send individual IRC lines, so if you're using them to send the individual lines of a client batch, you risk interleaving it with responses sent asynchronously from handlers (e.g. the PING handler).

This isn't major surgery at the implementation level because pwrite already takes a []byte:

pwrite chan []byte // receives IRC lines to be sent to the socket

Right now it's always used to send one line at a time, but there's nothing preventing us from concatenating multiple messages and pushing the concatenated message onto pwrite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant