mIRC Home    About    Download    Register    News    Help

Print Thread
Incoming message length #267455 09/07/20 04:08 AM
Joined: Dec 2002
Posts: 344
D
drum Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
Hello! Long time no post! wink

I have been using mIRC to connect to Twitch's IRC chatbot interface and have noticed that mIRC will truncate incoming messages that are longer than 1025 bytes -- which includes any IRCv3 message tags that are present. Twitch in some cases can send messages that are longer than this since they use message tags to store a lot of metadata.

I was looking over the IRCv3 message tags spec ( https://ircv3.net/specs/extensions/message-tags ) and noticed that it says the following:

Quote
The size limit for message tags is 8191 bytes, including the leading '@' (0x40) and trailing space ' ' (0x20) characters. The size limit for the rest of the message remains unchanged at 512 bytes.


Is there a particular reason that incoming messages are being truncated at 1025 bytes? Could the limit be raised? I understand a supported message length greater than $maxlenl would probably be a bad idea, but could it perhaps be raised to something like 4096? Would that cause any issues?

Thanks!

Re: Incoming message length [Re: drum] #267457 09/07/20 11:45 AM
Joined: Dec 2002
Posts: 4,753
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,753
Thanks for your bug report. I have not been able to reproduce this issue so far.

Can you provide an example that reproduces this issue?

Your example would need to be a step by step method that I can follow to cause a server to send mIRC a line longer than 1024 characters.

Alternatively, you can simulate incoming messages using /parseline, for example:

Code
test {
  var %text = A long line of text
  echo text len: $len(%text)
  parseline -itqp :nick!user@host PRIVMSG $me : $+ %text
}

Re: Incoming message length [Re: Khaled] #267463 10/07/20 01:22 AM
Joined: Dec 2002
Posts: 344
D
drum Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
I wasn't able to reproduce the issue using /parseline either.

Here's how you can reproduce the issue on a fresh mIRC install:

Code
alias start {
  server -f irc.chat.twitch.tv +6697 blah -i $+(justinfan,$rand(0,9),$rand(0,9),$rand(0,9),$rand(0,9),$rand(0,9),$rand(0,9))
  server -fm irc.chat.twitch.tv +6697 oauth:zbfeqk3n6tsyw60q7ssd40i1f0531r -i mirctest
}

on *:CONNECT:{
  if ($me != mirctest) {
    debug @debug
    raw CAP REQ :twitch.tv/tags
    join #mirctest
  }
}

alias test { scon 2 msg #mirctest $str($+(<3,$chr(32)),130) }

alias test2 { scon 2 msg #mirctest $str($+(<3,$chr(32)),90) }

alias test3 { scon 2 msg #mirctest $str($+(<3,$chr(32)),40) }


  • Type /start to connect.
  • Type /test to receive a message that truncates in the middle of the message tags (doesn't even get to the PRIVMSG command).
  • Type /test2 to receive a message that truncates in the middle of the message text.
  • Type /test3 to receive a normal message (no truncation).


Note that this script uses an oauth token to authenticate to a Twitch account named mirctest (created exclusively for this purpose) so that it can send messages. The first connection can only receive messages.

Last edited by drum; 10/07/20 02:55 AM.
Re: Incoming message length [Re: drum] #267464 10/07/20 08:41 AM
Joined: Dec 2002
Posts: 4,753
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,753
Thanks for the test script. I have not tested it yet, however, is it possible that the server itself is not sending the full line?

If you type /debug on to enable debugging to a debug.log file, this will log incoming server lines, up to a maximum of $maxlenl length, which is currently 8192 characters.

Re: Incoming message length [Re: drum] #267465 10/07/20 11:28 AM
Joined: Apr 2010
Posts: 943
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 943
This is not the fault of mIRC; it is twitch chopping the message. You can produce the same results, drum using their websocket interface:

1. Open a new tab
2. hit f12
3. click the "network" tab
4. navigate to twitch.tv/mirctest
5. select the irc websocket in the network tab
6. send various sized messages and watch the return frames twitch sends back


I am SReject
My Stuff
Re: Incoming message length [Re: FroggieDaFrog] #267466 10/07/20 02:54 PM
Joined: Dec 2002
Posts: 344
D
drum Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
I'm not seeing any chopped message on the browser side:

[Linked Image from i.imgur.com]

Notice that the highlighted message in blue is 1658 bytes in length. Here is the same message received by mIRC as viewed in a /debug window:

[Linked Image from i.imgur.com]

Notice in the /debug window, it chops after ",375-37" whereas this clearly keeps going in the browser version (seen at the bottom of the first image).

This message is the one generated by typing /test with the example script I gave.

Last edited by drum; 10/07/20 03:51 PM.
Re: Incoming message length [Re: Khaled] #267467 10/07/20 03:16 PM
Joined: Dec 2002
Posts: 344
D
drum Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
I have confirmed that the server is sending the full line both with Wireshark and with the method Froggie just mentioned.

Re: Incoming message length [Re: drum] #267468 10/07/20 04:59 PM
Joined: Dec 2002
Posts: 4,753
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,753
Thanks for the feedback and test script. I was able to reproduce the issue. This issue has been fixed for the next version.

Re: Incoming message length [Re: Khaled] #267469 10/07/20 10:43 PM
Joined: Dec 2002
Posts: 344
D
drum Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
Excellent, thank you!