You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "DaanHoogland (via GitHub)" <gi...@apache.org> on 2025/11/27 12:52:46 UTC
Re: [PR] Change protocol strings to enum values in parsing Protocol options [cloudstack]
DaanHoogland commented on code in PR #12135:
URL: https://github.com/apache/cloudstack/pull/12135#discussion_r2568530121
##########
services/console-proxy/rdpconsole/src/main/java/common/Client.java:
##########
@@ -299,16 +299,16 @@ private Element setMainElementAndAddressBasedOnProtocol(Protocol protocol, SSLSt
private Protocol parseOptions(String[] args) {
String protocolName = (args.length > 0) ? args[0] : "";
- Protocol protocol = Protocol.NONE;
+ Protocol protocol;
Review Comment:
```suggestion
Protocol protocol;
try {
protocol = Protocol.valueOf(protocolName);
} catch (IllegalArgumentException e) {
protocol = Protocol.NONE;
}
```
##########
services/console-proxy/rdpconsole/src/main/java/common/Client.java:
##########
Review Comment:
```suggestion
switch (protocol) {
case VNC:
options = join(commonOptions, vncOptions);
break;
case RDP:
options = join(commonOptions, rdpOptions);
break;case HYPERV:
options = join(commonOptions, hyperVOptions);
break;
case NONE:
help();
return Protocol.NONE;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org