-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Labels
compatibilityCompatibility with modsCompatibility with modsexternal issueShould be handled on external sideShould be handled on external side
Description
To reproduce
-
Setup a server with carpet-tis-additon installed, setup a velocity server as the reversed proxy, join the server with carpet-tis-addition
-
Run in Minecraft console
/carpet setDefault tiscmNetworkProtocol true
/carpet setDefault commandSpeedTest true
- Join the serveer, run in game:
/speedtest download 10
- The client gets disconnected
[03:36:24 INFO]: Booting up Velocity 3.4.0-SNAPSHOT (git-bd2bb632-b496)...
[03:36:24 INFO]: Loading localizations...
[03:36:24 INFO]: Connections will use NIO channels, Java compression, Java ciphers
[03:36:24 WARN]: Player info forwarding is disabled! All players will appear to be connecting from the proxy and will have offline-mode UUIDs.
[03:36:24 INFO]: Loading plugins...
[03:36:24 INFO]: Loaded 1 plugins
[03:36:24 INFO]: Listening on /[0:0:0:0:0:0:0:0]:25565
[03:36:24 INFO]: Done (0.75s)!
[03:36:29 INFO]: [connected player] Fallen_Breath (/127.0.0.1:62055) has connected
[03:36:29 INFO]: [server connection] Fallen_Breath -> lobby has connected
[03:36:32 INFO]: [connected player] Fallen_Breath (/127.0.0.1:62055) has disconnected: Your connection to lobby encountered a problem.
The exception is:
io.netty.handler.codec.CorruptedFrameException: Actual uncompressed size 16384 is greater than threshold 256
at com.velocitypowered.proxy.protocol.util.NettyPreconditions.checkFrame(NettyPreconditions.java:83) ~[velocity-proxy-3.4.0-SNAPSHOT-all.jar:3.4.0-SNAPSHOT (git-b1e5cdcf)]
at com.velocitypowered.proxy.protocol.netty.MinecraftCompressDecoder.decode(MinecraftCompressDecoder.java:56) ~[velocity-proxy-3.4.0-SNAPSHOT-all.jar:3.4.0-SNAPSHOT (git-b1e5cdcf)]
at com.velocitypowered.proxy.protocol.netty.MinecraftCompressDecoder.decode(MinecraftCompressDecoder.java:34) ~[velocity-proxy-3.4.0-SNAPSHOT-all.jar:3.4.0-SNAPSHOT (git-b1e5cdcf)]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:91) ~[velocity-proxy-3.4.0-SNAPSHOT-all.jar:3.4.0-SNAPSHOT (git-b1e5cdcf)]
...
Why
The issue is introduced by velocity's PR PaperMC/Velocity#1527 (PaperMC/Velocity@d9f1016), it adds a check on those uncompressed packet that throws an exception if the size of the uncompressed packet exceeded the compress threshold
Lines 52 to 71 in 7582ba2
| /** | |
| * Detect speed test payload to cancelling the compression, for less CPU usage | |
| */ | |
| @ModifyExpressionValue( | |
| method = "encode(Lio/netty/channel/ChannelHandlerContext;Lio/netty/buffer/ByteBuf;Lio/netty/buffer/ByteBuf;)V", | |
| at = @At( | |
| value = "FIELD", | |
| target = "Lnet/minecraft/network/PacketDeflater;compressionThreshold:I", | |
| ordinal = 0 | |
| ) | |
| ) | |
| private int dontCompressSpeedTestPayloadPackets(int compressionThreshold, @Local(argsOnly = true, ordinal = 0) ByteBuf bufInput) | |
| { | |
| if (SpeedTestCompressionSkipper.isSpeedTestPayloadPacket(this, bufInput)) | |
| { | |
| return Integer.MAX_VALUE; | |
| } | |
| return compressionThreshold; | |
| } | |
| } |
Affects
Affected commands:
/speedtest download
/speedtest upload
More information
Carpet TIS Addition needs to send large packet in an uncompressed state, to
avoid packet compression becoming a bottleneck in network speed testing. So it cannot be fixed on the Carpet TIS Addition side
Issue on the velocity side: PaperMC/Velocity#1556
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
compatibilityCompatibility with modsCompatibility with modsexternal issueShould be handled on external sideShould be handled on external side