Skip to content

Commit

Permalink
#2261: Don't send any keep alive to server if invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
md-5 committed Sep 23, 2017
1 parent 69bbc3a commit 8d49424
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
3 changes: 0 additions & 3 deletions proxy/src/main/java/net/md_5/bungee/ServerConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public class ServerConnection implements Server
private final boolean forgeServer = false;
@Getter
@Setter
private boolean pingFailed;
@Getter
@Setter
private long sentPingId = -1;

private final Unsafe unsafe = new Unsafe()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,6 @@ public void handle(KeepAlive alive) throws Exception
con.setPing( newPing );
} else
{
if ( con.getServer().getSentPingId() != -1 && !con.getServer().isPingFailed() )
{
alive.setRandomId( con.getServer().getSentPingId() );
con.getServer().unsafe().sendPacket( alive );

con.getServer().setPingFailed( true );
con.getServer().setSentPingId( -1 );
}

throw CancelSendSignal.INSTANCE;
}
}
Expand Down

0 comments on commit 8d49424

Please sign in to comment.