d4f7f7b22b
Change-Id: Ife18effd9e477e977e555aea03a78b312e99c6c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157472 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
42 lines
1.8 KiB
Diff
42 lines
1.8 KiB
Diff
From 695941c8da3e6cefa0553996773a8cf8673bb00e Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolan.mcnamara@collabora.com>
|
|
Date: Sun, 1 Oct 2023 19:50:02 +0100
|
|
Subject: [PATCH] cid#1545515 Dm: Dubious method used
|
|
|
|
---
|
|
src/main/java/org/java_websocket/WebSocketImpl.java | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/main/java/org/java_websocket/WebSocketImpl.java b/src/main/java/org/java_websocket/WebSocketImpl.java
|
|
index 85fd413..926f330 100644
|
|
--- a/src/main/java/org/java_websocket/WebSocketImpl.java
|
|
+++ b/src/main/java/org/java_websocket/WebSocketImpl.java
|
|
@@ -30,6 +30,7 @@
|
|
import java.nio.ByteBuffer;
|
|
import java.nio.channels.ByteChannel;
|
|
import java.nio.channels.SelectionKey;
|
|
+import java.nio.charset.StandardCharsets;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.Collections;
|
|
@@ -227,7 +228,7 @@
|
|
if (log.isLoggable(Level.FINE)) {
|
|
log.fine("process({}): ({})" + " : " + socketBuffer.remaining() + " : " +
|
|
(socketBuffer.remaining() > 1000 ? "too big to display"
|
|
- : new String(socketBuffer.array(), socketBuffer.position(), socketBuffer.remaining())));
|
|
+ : new String(socketBuffer.array(), socketBuffer.position(), socketBuffer.remaining(), StandardCharsets.US_ASCII)));
|
|
}
|
|
if (readyState != ReadyState.NOT_YET_CONNECTED) {
|
|
if (readyState == ReadyState.OPEN) {
|
|
@@ -740,7 +741,7 @@
|
|
|
|
private void write(ByteBuffer buf) {
|
|
log.fine("write({}): {}" + " : " + buf.remaining() + " : " +
|
|
- (buf.remaining() > 1000 ? "too big to display" : new String(buf.array())));
|
|
+ (buf.remaining() > 1000 ? "too big to display" : new String(buf.array(), StandardCharsets.US_ASCII)));
|
|
|
|
outQueue.add(buf);
|
|
wsl.onWriteDemand(this);
|
|
--
|
|
2.41.0
|
|
|