-
Notifications
You must be signed in to change notification settings - Fork 8
Description
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:
Line 75 in 36a8aad
| 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.