Messages are not delivered correctly when server respondes with UNIX-like line delimiter.
Closed this issue · 2 comments
Expected behavior
The message with \n
delimiter is processed correctly. Appears as #315 before I found it was a bug.
Actual behavior
The message with \n
delimiter didn't get split. Only \r\n
, which is Windows style delimiter get split.
Stacktrace
No stack trace. But the problematic code was at https://github.com/KittehOrg/KittehIRCClientLib/blob/master/src/main/java/org/kitteh/irc/client/library/defaults/feature/network/NettyConnection.java#L158.
To Reproduce
- Connect to non-standard IRC server like
irc.ppy.sh
- Join a channel
- Unable to receive messages
Version information
- OS: Arch linux
- JVM: OpenJDK 22.0.2+9
- KICL version: 9.0.0
Additional context
Packet hex dump below:
0000 3a 79 6f 75 72 73 74 61 72 79 38 35 21 63 68 6f :yourstary85!cho
0010 40 70 70 79 2e 73 68 20 51 55 49 54 20 3a 71 75 @ppy.sh QUIT :qu
0020 69 74 0a 3a 65 6d 69 72 72 21 63 68 6f 40 70 70 it.:emirr!cho@pp
0030 79 2e 73 68 20 51 55 49 54 20 3a 71 75 69 74 0a y.sh QUIT :quit.
0040 3a 47 61 64 7a 61 31 33 33 37 21 63 68 6f 40 70 :Gadza1337!cho@p
0050 70 79 2e 73 68 20 51 55 49 54 20 3a 71 75 69 74 py.sh QUIT :quit
0060 0a 3a 62 63 61 64 65 6d 30 76 30 21 63 68 6f 40 .:bcadem0v0!cho@
0070 70 70 79 2e 73 68 20 51 55 49 54 20 3a 71 75 69 ppy.sh QUIT :qui
0080 74 0a 3a 44 6f 67 67 6f 4f 73 75 42 6f 69 21 63 t.:DoggoOsuBoi!c
0090 68 6f 40 70 70 79 2e 73 68 20 51 55 49 54 20 3a ho@ppy.sh QUIT :
00a0 72 65 70 6c 61 63 65 64 20 28 4e 6f 72 6d 61 6c replaced (Normal
00b0 20 36 65 35 33 61 34 34 30 2d 38 62 36 32 2d 34 6e53a440-8b62-4
00c0 62 33 62 2d 62 31 30 62 2d 31 32 34 33 62 61 36 b3b-b10b-1243ba6
00d0 39 39 38 38 34 29 0a 3a 57 65 65 62 47 61 6d 65 99884).:WeebGame
00e0 72 36 34 31 31 21 63 68 6f 40 70 70 79 2e 73 68 r6411!cho@ppy.sh
00f0 20 51 55 49 54 20 3a 71 75 69 74 0a 3a 47 5a 4a QUIT :quit.:GZJ
0100 36 36 36 21 63 68 6f 40 70 70 79 2e 73 68 20 51 666!cho@ppy.sh Q
0110 55 49 54 20 3a 71 75 69 74 0a 3a 52 65 78 4d 75 UIT :quit.:RexMu
0120 6e 64 69 21 63 68 6f 40 70 70 79 2e 73 68 20 51 ndi!cho@ppy.sh Q
0130 55 49 54 20 3a 71 75 69 74 0a 3a 72 61 6e 64 6f UIT :quit.:rando
0140 6d 5f 67 75 79 39 38 37 21 63 68 6f 40 70 70 79 m_guy987!cho@ppy
0150 2e 73 68 20 51 55 49 54 20 3a 71 75 69 74 0a 3a .sh QUIT :quit.:
0160 4c 6f 76 65 54 6f 4c 69 76 65 21 63 68 6f 40 70 LoveToLive!cho@p
0170 70 79 2e 73 68 20 51 55 49 54 20 3a 71 75 69 74 py.sh QUIT :quit
0180 0a 3a 42 61 6e 63 68 6f 42 6f 74 21 63 68 6f 40 .:BanchoBot!cho@
0190 70 70 79 2e 73 68 20 50 52 49 56 4d 53 47 20 23 ppy.sh PRIVMSG #
01a0 6d 70 5f 31 31 35 31 39 38 31 37 33 20 3a 52 6f mp_115198173 :Ro
01b0 6f 6d 20 6e 61 6d 65 3a 20 4f 46 46 43 20 54 65 om name: OFFC Te
01c0 73 74 3a 20 28 52 65 64 20 54 65 61 6d 29 20 76 st: (Red Team) v
01d0 73 20 28 42 6c 75 65 20 54 65 61 6d 29 2c 20 48 s (Blue Team), H
01e0 69 73 74 6f 72 79 3a 20 68 74 74 70 73 3a 2f 2f istory: https://
01f0 6f 73 75 2e 70 70 79 2e 73 68 2f 6d 70 2f 31 31 osu.ppy.sh/mp/11
0200 35 31 39 38 31 37 33 0a 3a 42 61 6e 63 68 6f 42 5198173.:BanchoB
0210 6f 74 21 63 68 6f 40 70 70 79 2e 73 68 20 50 52 ot!cho@ppy.sh PR
0220 49 56 4d 53 47 20 23 6d 70 5f 31 31 35 31 39 38 IVMSG #mp_115198
0230 31 37 33 20 3a 54 65 61 6d 20 6d 6f 64 65 3a 20 173 :Team mode:
0240 54 65 61 6d 56 73 2c 20 57 69 6e 20 63 6f 6e 64 TeamVs, Win cond
0250 69 74 69 6f 6e 3a 20 53 63 6f 72 65 56 32 0a 3a ition: ScoreV2.:
0260 42 61 6e 63 68 6f 42 6f 74 21 63 68 6f 40 70 70 BanchoBot!cho@pp
0270 79 2e 73 68 20 50 52 49 56 4d 53 47 20 23 6d 70 y.sh PRIVMSG #mp
0280 5f 31 31 35 31 39 38 31 37 33 20 3a 50 6c 61 79 _115198173 :Play
0290 65 72 73 3a 20 30 0a ers: 0.
IRC uses \r\n
as the message separator. Please report this issue to the server.
Sources:
IRC uses
\r\n
as the message separator. Please report this issue to the server.Sources:
* [Modern spec](https://modern.ircdocs.horse/#message-format) * [Ancient spec](https://datatracker.ietf.org/doc/html/rfc1459#section-2.3.1) * [Less-loved spec](https://datatracker.ietf.org/doc/html/rfc2812#section-2.3.1)
Oh. Since their IRC server is deprecated and no longer updated, I decided not to report it.
Thanks for telling me the specifications.