From 517dbd9c85842797ec8bf21ced2ddc4040a87230 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 24 May 2020 14:28:58 +0200 Subject: [PATCH] Increase buffer size to fix "set clipboard" event The buffer size must be greater than any event message. Clipboard events may take up to 4096 bytes, so increase the buffer size. Fixes #1425 --- .../main/java/com/genymobile/scrcpy/ControlMessageReader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/ControlMessageReader.java b/server/src/main/java/com/genymobile/scrcpy/ControlMessageReader.java index 1c0810580e..2688641c73 100644 --- a/server/src/main/java/com/genymobile/scrcpy/ControlMessageReader.java +++ b/server/src/main/java/com/genymobile/scrcpy/ControlMessageReader.java @@ -15,7 +15,8 @@ public class ControlMessageReader { public static final int CLIPBOARD_TEXT_MAX_LENGTH = 4093; public static final int INJECT_TEXT_MAX_LENGTH = 300; - private static final int RAW_BUFFER_SIZE = 1024; + + private static final int RAW_BUFFER_SIZE = 4096; private final byte[] rawBuffer = new byte[RAW_BUFFER_SIZE]; private final ByteBuffer buffer = ByteBuffer.wrap(rawBuffer);