From b3042312f62e1d0f16a373e9eacb65151f64c396 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 5 Mar 2016 18:32:50 -0600 Subject: [PATCH] Supply the max packet size to EnetConnection.readPacket() --- .../src/com/limelight/nvstream/control/ControlStream.java | 2 +- .../src/com/limelight/nvstream/enet/EnetConnection.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moonlight-common/src/com/limelight/nvstream/control/ControlStream.java b/moonlight-common/src/com/limelight/nvstream/control/ControlStream.java index 4d5659e3..ed5020f9 100644 --- a/moonlight-common/src/com/limelight/nvstream/control/ControlStream.java +++ b/moonlight-common/src/com/limelight/nvstream/control/ControlStream.java @@ -200,7 +200,7 @@ public class ControlStream implements ConnectionStatusListener, InputPacketSende synchronized (this) { sendPacket(packet); if (context.serverGeneration >= ConnectionContext.SERVER_GENERATION_5) { - enetConnection.readPacket(CONTROL_TIMEOUT); + enetConnection.readPacket(128, CONTROL_TIMEOUT); } else { new NvCtlResponse(in); diff --git a/moonlight-common/src/com/limelight/nvstream/enet/EnetConnection.java b/moonlight-common/src/com/limelight/nvstream/enet/EnetConnection.java index d7eb6602..b49368d6 100644 --- a/moonlight-common/src/com/limelight/nvstream/enet/EnetConnection.java +++ b/moonlight-common/src/com/limelight/nvstream/enet/EnetConnection.java @@ -37,8 +37,8 @@ public class EnetConnection implements Closeable { return conn; } - public ByteBuffer readPacket(int timeout) throws IOException { - ByteBuffer buffer = ByteBuffer.allocate(128); + public ByteBuffer readPacket(int maxSize, int timeout) throws IOException { + ByteBuffer buffer = ByteBuffer.allocate(maxSize); int readLength = readPacket(enetClient, buffer.array(), buffer.limit(), timeout); if (readLength <= 0) {