Skip to content

Commit

Permalink
Documenting options incompatible with -webSocket.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Dec 11, 2019
1 parent 47ea945 commit 86cea5b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/main/java/hudson/remoting/Engine.java
Expand Up @@ -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;
}
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/hudson/remoting/jnlp/Main.java
Expand Up @@ -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();
}

Expand Down

0 comments on commit 86cea5b

Please sign in to comment.