slavkap commented on code in PR #7015:
URL: https://github.com/apache/cloudstack/pull/7015#discussion_r1055559810
##########
services/console-proxy/server/src/main/java/com/cloud/consoleproxy/vnc/network/NioSocketTLSOutputStream.java:
##########
@@ -33,33 +36,30 @@ public NioSocketTLSOutputStream(SSLEngineManager
sslEngineManager, NioSocket soc
public void flushWriteBuffer() {
int sentUpTo = start;
while (sentUpTo < currentPosition) {
- int n = writeTLS(buffer, sentUpTo, currentPosition - sentUpTo);
+ int n = writeThroughSSLEngineManager(buffer, sentUpTo,
currentPosition - sentUpTo);
sentUpTo += n;
offset += n;
}
currentPosition = start;
}
- protected int writeTLS(byte[] data, int dataPtr, int length) {
- int n;
+ protected int writeThroughSSLEngineManager(byte[] data, int startPos, int
length) {
try {
- n = sslEngineManager.write(ByteBuffer.wrap(data, dataPtr, length),
length);
- } catch (java.io.IOException e) {
- throw new CloudRuntimeException(e.getMessage());
+ return sslEngineManager.write(ByteBuffer.wrap(data, startPos,
length));
+ } catch (IOException e) {
+ s_logger.error("Error writing though SSL engine manager: " +
e.getMessage(), e);
Review Comment:
```suggestion
s_logger.error(String.format("Error writing though SSL engine
manager: %s", e.getMessage()), e);
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]