Add handling for INVALID_CLASS case

This commit is contained in:
Manfred Karrer 2016-10-12 23:35:48 +02:00
parent b2b66d42a8
commit 8d9e330916
2 changed files with 4 additions and 1 deletions

View file

@ -24,7 +24,8 @@ public enum CloseConnectionReason {
// illegal requests
RULE_VIOLATION(true, false),
PEER_BANNED(true, false);
PEER_BANNED(true, false),
INVALID_CLASS_RECEIVED(false, false);
public final boolean sendCloseMessage;
public boolean isIntended;

View file

@ -591,6 +591,8 @@ public class Connection implements MessageListener {
if (ruleViolation == RuleViolation.PEER_BANNED) {
log.warn("We detected a connection to a banned peer. We will close that connection. (reportInvalidRequest)");
shutDown(CloseConnectionReason.PEER_BANNED);
} else if (ruleViolation == RuleViolation.INVALID_CLASS) {
shutDown(CloseConnectionReason.INVALID_CLASS_RECEIVED);
} else {
shutDown(CloseConnectionReason.RULE_VIOLATION);
}