13
0
geforkt von Mirrors/Velocity

Make sure to issue a backpressure-solving flush on a future iteration of the event loop

Thanks to @Spottedleaf for finding this issue.
Dieser Commit ist enthalten in:
Andrew Steinborn 2021-08-04 23:37:27 -04:00
Ursprung c32bc88064
Commit d3ff6f8e33

Datei anzeigen

@ -335,8 +335,11 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
boolean writable = player.getConnection().getChannel().isWritable();
if (!writable) {
// We might have packets queued from the server, so flush them now to free up memory.
player.getConnection().flush();
// We might have packets queued from the server, so flush them now to free up memory. Make
// sure to do it on a future invocation of the event loop, otherwise while the issue will
// fix itself, we'll still disable auto-reading and instead of backpressure resolution, we
// get client timeouts.
player.getConnection().eventLoop().execute(() -> player.getConnection().flush());
}
VelocityServerConnection serverConn = player.getConnectedServer();