Fix issue with plugins sending plugin messages causing login to hang - often seen in bukkit->bungee plugins
Dieser Commit ist enthalten in:
Ursprung
30aef50359
Commit
e710c42e46
@ -1,4 +1,4 @@
|
||||
From 3f4c6866021b6be78d1e74707730b18a0323bbe2 Mon Sep 17 00:00:00 2001
|
||||
From cf9f87164540e86ffc374ea90f0c1e7e9674a29d Mon Sep 17 00:00:00 2001
|
||||
From: md_5 <md_5@live.com.au>
|
||||
Date: Tue, 23 Apr 2013 11:47:32 +1000
|
||||
Subject: [PATCH] Netty
|
||||
@ -471,7 +471,7 @@ index 0000000..aa8192e
|
||||
+}
|
||||
diff --git a/src/main/java/org/spigotmc/netty/NettyNetworkManager.java b/src/main/java/org/spigotmc/netty/NettyNetworkManager.java
|
||||
new file mode 100644
|
||||
index 0000000..638a70e
|
||||
index 0000000..a9224d9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/spigotmc/netty/NettyNetworkManager.java
|
||||
@@ -0,0 +1,254 @@
|
||||
@ -536,7 +536,7 @@ index 0000000..638a70e
|
||||
+ private volatile boolean connected;
|
||||
+ private Channel channel;
|
||||
+ private SocketAddress address;
|
||||
+ private Connection connection;
|
||||
+ Connection connection;
|
||||
+ private SecretKey secret;
|
||||
+ private String dcReason;
|
||||
+ private Object[] dcArgs;
|
||||
@ -731,7 +731,7 @@ index 0000000..638a70e
|
||||
+}
|
||||
diff --git a/src/main/java/org/spigotmc/netty/NettyServerConnection.java b/src/main/java/org/spigotmc/netty/NettyServerConnection.java
|
||||
new file mode 100644
|
||||
index 0000000..cb58bd2
|
||||
index 0000000..7a621aa
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/spigotmc/netty/NettyServerConnection.java
|
||||
@@ -0,0 +1,81 @@
|
||||
@ -779,7 +779,7 @@ index 0000000..cb58bd2
|
||||
+
|
||||
+ NettyNetworkManager networkManager = new NettyNetworkManager();
|
||||
+ ch.pipeline()
|
||||
+ .addLast("flusher", new OutboundManager())
|
||||
+ .addLast("flusher", new OutboundManager(networkManager))
|
||||
+ .addLast("timer", new ReadTimeoutHandler(30))
|
||||
+ .addLast("decoder", new PacketDecoder())
|
||||
+ .addLast("encoder", new PacketEncoder(networkManager))
|
||||
@ -1072,26 +1072,36 @@ index 0000000..a3b86b8
|
||||
+}
|
||||
diff --git a/src/main/java/org/spigotmc/netty/OutboundManager.java b/src/main/java/org/spigotmc/netty/OutboundManager.java
|
||||
new file mode 100644
|
||||
index 0000000..758923c
|
||||
index 0000000..5e7e950
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/spigotmc/netty/OutboundManager.java
|
||||
@@ -0,0 +1,19 @@
|
||||
@@ -0,0 +1,29 @@
|
||||
+package org.spigotmc.netty;
|
||||
+
|
||||
+import io.netty.channel.ChannelHandlerContext;
|
||||
+import io.netty.channel.ChannelOperationHandlerAdapter;
|
||||
+import io.netty.channel.ChannelPromise;
|
||||
+import net.minecraft.server.PendingConnection;
|
||||
+
|
||||
+public class OutboundManager extends ChannelOperationHandlerAdapter {
|
||||
+public class OutboundManager extends ChannelOperationHandlerAdapter
|
||||
+{
|
||||
+
|
||||
+ private static final int FLUSH_TIME = 3;
|
||||
+ private long lastFlush;
|
||||
+ private final NettyNetworkManager manager;
|
||||
+ public boolean flushNow = false;
|
||||
+
|
||||
+ public void flush(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception {
|
||||
+ if (flushNow || System.currentTimeMillis() - lastFlush > FLUSH_TIME) {
|
||||
+ OutboundManager(NettyNetworkManager manager)
|
||||
+ {
|
||||
+ this.manager = manager;
|
||||
+ }
|
||||
+
|
||||
+ public void flush(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception
|
||||
+ {
|
||||
+ if ( flushNow || manager.connection instanceof PendingConnection || System.currentTimeMillis() - lastFlush > FLUSH_TIME )
|
||||
+ {
|
||||
+ lastFlush = System.currentTimeMillis();
|
||||
+ ctx.flush(promise);
|
||||
+ ctx.flush( promise );
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren