From 86cea5b83fd2fc93a9fc10896962eb42c95f80a0 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 11 Dec 2019 16:20:25 -0500 Subject: [PATCH] Documenting options incompatible with -webSocket. --- src/main/java/hudson/remoting/Engine.java | 1 - src/main/java/hudson/remoting/jnlp/Main.java | 32 ++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main/java/hudson/remoting/Engine.java b/src/main/java/hudson/remoting/Engine.java index ca957488f..75046c9da 100644 --- a/src/main/java/hudson/remoting/Engine.java +++ b/src/main/java/hudson/remoting/Engine.java @@ -458,7 +458,6 @@ public void removeListener(EngineListener el) { @Override public void run() { if (webSocket) { - // TODO check for inappropriate options like tunnel, disableHttpsCertValidation, etc. runWebSocket(); return; } diff --git a/src/main/java/hudson/remoting/jnlp/Main.java b/src/main/java/hudson/remoting/jnlp/Main.java index 8f8013b4a..ee70b807e 100644 --- a/src/main/java/hudson/remoting/jnlp/Main.java +++ b/src/main/java/hudson/remoting/jnlp/Main.java @@ -271,6 +271,38 @@ public static void _main(String[] args) throws IOException, InterruptedException if(m.urls.isEmpty() && m.directConnection == null) { throw new CmdLineException(p, "At least one -url option is required.", null); } + if (m.webSocket) { + if (m.urls.isEmpty()) { + throw new CmdLineException(p, "-url is required in -webSocket mode", null); + } + if (m.urls.size() > 1) { + throw new CmdLineException(p, "multiple -url is not currently supported in -webSocket mode", null); + } + if (m.directConnection != null) { + throw new CmdLineException(p, "-webSocket and -direct are mutually exclusive", null); + } + if (m.tunnel != null) { + throw new CmdLineException(p, "-tunnel is not currently supported in -webSocket mode", null); + } + if (m.credentials != null) { + throw new CmdLineException(p, "-credentials is not currently supported in -webSocket mode", null); + } + if (m.proxyCredentials != null) { + throw new CmdLineException(p, "-proxyCredentials is not currently supported in -webSocket mode", null); + } + if (m.candidateCertificates != null) { + throw new CmdLineException(p, "-candidateCertificates is not currently supported in -webSocket mode", null); + } + if (m.disableHttpsCertValidation) { + throw new CmdLineException(p, "-disableHttpsCertValidation is not currently supported in -webSocket mode", null); + } + if (m.noKeepAlive) { + throw new CmdLineException(p, "-noKeepAlive is not currently supported in -webSocket mode", null); + } + if (m.noReconnect) { + throw new CmdLineException(p, "-noReconnect is not currently supported in -webSocket mode", null); + } + } m.main(); }