From fd4dec6dec09a2c21112e4e466c84b4d51d39187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 29 May 2024 17:51:27 +0200 Subject: [PATCH] Format --- src/main/java/com/rabbitmq/perf/PerfTest.java | 6 ++-- src/main/java/com/rabbitmq/perf/Utils.java | 30 +++++++++++-------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/rabbitmq/perf/PerfTest.java b/src/main/java/com/rabbitmq/perf/PerfTest.java index 7370cf0a..e5a24574 100644 --- a/src/main/java/com/rabbitmq/perf/PerfTest.java +++ b/src/main/java/com/rabbitmq/perf/PerfTest.java @@ -1357,8 +1357,10 @@ static Options getOptions() { false, "Same as --verbose, but with message headers and body as well. Use only with slow rates.")); - options.addOption(new Option("tsbs", "tcp-send-buffer-size", true, "value for TCP SO_SNDBUF option")); - options.addOption(new Option("trbs", "tcp-receive-buffer-size", true, "value for TCP SO_RCVBUF option")); + options.addOption( + new Option("tsbs", "tcp-send-buffer-size", true, "value for TCP SO_SNDBUF option")); + options.addOption( + new Option("trbs", "tcp-receive-buffer-size", true, "value for TCP SO_RCVBUF option")); return options; } diff --git a/src/main/java/com/rabbitmq/perf/Utils.java b/src/main/java/com/rabbitmq/perf/Utils.java index 4972be77..c5141322 100644 --- a/src/main/java/com/rabbitmq/perf/Utils.java +++ b/src/main/java/com/rabbitmq/perf/Utils.java @@ -141,18 +141,21 @@ static SocketConfigurator socketConfigurator(CommandLineProxy cmd) { SocketConfigurator socketConfigurator = SocketConfigurators.defaultConfigurator(); List serverNames = sniServerNames(strArg(cmd, "sni", null)); if (!serverNames.isEmpty()) { - socketConfigurator = socketConfigurator.andThen(socket -> { - if (socket instanceof SSLSocket) { - SSLSocket sslSocket = (SSLSocket) socket; - SSLParameters sslParameters = - sslSocket.getSSLParameters() == null - ? new SSLParameters() - : sslSocket.getSSLParameters(); - sslParameters.setServerNames(serverNames); - sslSocket.setSSLParameters(sslParameters); - } else { - LOGGER.warn("SNI parameter set on a non-TLS connection"); - }}); + socketConfigurator = + socketConfigurator.andThen( + socket -> { + if (socket instanceof SSLSocket) { + SSLSocket sslSocket = (SSLSocket) socket; + SSLParameters sslParameters = + sslSocket.getSSLParameters() == null + ? new SSLParameters() + : sslSocket.getSSLParameters(); + sslParameters.setServerNames(serverNames); + sslSocket.setSSLParameters(sslParameters); + } else { + LOGGER.warn("SNI parameter set on a non-TLS connection"); + } + }); } int sendBufferSize = intArg(cmd, "tsbs", -1); int receiveBufferSize = intArg(cmd, "trbs", -1); @@ -172,7 +175,8 @@ static SocketConfigurator socketConfigurator(CommandLineProxy cmd) { static SocketChannelConfigurator socketChannelConfigurator(CommandLineProxy cmd) { int sendBufferSize = intArg(cmd, "tsbs", -1); int receiveBufferSize = intArg(cmd, "trbs", -1); - return SocketChannelConfigurators.defaultConfigurator().andThen( + return SocketChannelConfigurators.defaultConfigurator() + .andThen( socketChannel -> { if (sendBufferSize > 0) { socketChannel.socket().setSendBufferSize(sendBufferSize);