From 479592c009c1c7982015d310a0a4faaa53aba8c0 Mon Sep 17 00:00:00 2001 From: MatrixTunnel Date: Fri, 10 Aug 2018 11:13:53 -0700 Subject: [PATCH] Fix invalid compression values not stopping proxy --- .../com/velocitypowered/proxy/config/VelocityConfiguration.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java b/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java index 13c97eff5..50ed31f27 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java @@ -128,12 +128,14 @@ public class VelocityConfiguration { if (compressionLevel < -1 || compressionLevel > 9) { logger.error("Invalid compression level {}", compressionLevel); + valid = false; } else if (compressionLevel == 0) { logger.warn("ALL packets going through the proxy are going to be uncompressed. This will increase bandwidth usage."); } if (compressionThreshold < -1) { logger.error("Invalid compression threshold {}", compressionLevel); + valid = false; } else if (compressionThreshold == 0) { logger.warn("ALL packets going through the proxy are going to be compressed. This may hurt performance."); }