PaperMC/paper-server/patches/sources/net/minecraft/server/network
Minecrell 361fc3ab43 Make legacy ping handler more reliable
The Minecraft server often fails to respond to old ("legacy") pings
from old Minecraft versions using the protocol used before the switch
to Netty in Minecraft 1.7.

Due to packet fragmentation[1], we might not have all needed bytes
available when the LegacyPingHandler is called. In this case, it will
run into an error, remove the handler and continue using the modern
protocol.

This is unlikely to happen for the first two revisions of the legacy
ping protocol (used in Minecraft 1.5.x and older) since the request
consists of only one or two bytes, but happens frequently for the
last/third revision introduced in Minecraft 1.6.

It has much larger, variable packet sizes due to the inclusion of
the virtual host (the hostname/port used to connect to the server).

The solution[2] is simple: If we find more than two matching bytes,
we buffer the remaining bytes until we have enough to fully read and
respond to the request.

[1]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h3-11
[2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13
2017-10-11 18:22:50 +02:00
..
LegacyQueryHandler.java.patch Make legacy ping handler more reliable 2017-10-11 18:22:50 +02:00
ServerCommonPacketListenerImpl.java.patch revert serverside behavior of keepalives 2017-10-15 00:29:07 +01:00
ServerConfigurationPacketListenerImpl.java.patch Adventure 2021-01-29 17:54:03 +01:00
ServerConnectionListener.java.patch Avoid blocking on Network Manager creation 2016-05-16 23:19:16 -04:00
ServerGamePacketListenerImpl.java.patch AsyncTabCompleteEvent 2017-11-26 13:19:58 -05:00
ServerHandshakePacketListenerImpl.java.patch Expose client protocol version and virtual host 2017-10-10 18:45:20 +02:00
ServerLoginPacketListenerImpl.java.patch Player.setPlayerProfile API 2018-03-18 12:29:48 -04:00
ServerStatusPacketListenerImpl.java.patch Implement extended PaperServerListPingEvent 2017-10-11 15:56:26 +02:00