From ccc81d4da0ddd6c9ea0f7628ecddba696612cb46 Mon Sep 17 00:00:00 2001 From: Tom Conkling Date: Fri, 5 Sep 2008 00:32:38 +0000 Subject: [PATCH] Whoops! git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5361 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/io/FrameReader.as | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/as/com/threerings/io/FrameReader.as b/src/as/com/threerings/io/FrameReader.as index 605296e24..681aa670a 100644 --- a/src/as/com/threerings/io/FrameReader.as +++ b/src/as/com/threerings/io/FrameReader.as @@ -63,8 +63,14 @@ public class FrameReader extends EventDispatcher "socketHasData(" + _socket.bytesAvailable + ")"); } - while (_socket.bytesAvailable >= HEADER_SIZE) { + while (_socket.bytesAvailable > 0) { if (_curData == null) { + if (_socket.bytesAvailable < HEADER_SIZE) { + // if there are less bytes available than a header, let's + // just leave them on the socket until we can read the length + // all at once + return; + } // the length specified is the length of the entire frame, // including the length of the bytes used to encode the length. // (I think this is pretty silly).