From 0ebfeadd21ef4b27649e6fb7dc235958d226bb94 Mon Sep 17 00:00:00 2001 From: Eric Lundberg Date: Mon, 7 Jul 2003 22:35:38 +0000 Subject: [PATCH] Seems to be some kind of issue with moving the length == -1 check inside the loop, so I'm rolling back to the previous version since I can't even log in to my server with this change. Mike if you want to take a look or tell me what jimmyjamming needs to be done to make this change work, that would be great. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2694 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/io/FramedInputStream.java | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/java/com/threerings/io/FramedInputStream.java b/src/java/com/threerings/io/FramedInputStream.java index c3058886a..f0ddd7a5f 100644 --- a/src/java/com/threerings/io/FramedInputStream.java +++ b/src/java/com/threerings/io/FramedInputStream.java @@ -1,5 +1,5 @@ // -// $Id: FramedInputStream.java,v 1.4 2003/07/06 18:39:55 mdb Exp $ +// $Id: FramedInputStream.java,v 1.5 2003/07/07 22:35:38 eric Exp $ package com.threerings.io; @@ -96,18 +96,6 @@ public class FramedInputStream extends InputStream // what we've got if (_buffer.remaining() > 0) { break; - } else if (_length == -1) { - // if we didn't already have our length, see if we now have - // enough data to obtain it - _length = decodeLength(); - } - - // additionally, if the buffer happened to be exactly as long - // as we needed, we need to break as well - if ((_length > 0) && (_have >= _length)) { - System.err.println("Phew, we would have been screwed in " + - "the previous release (" + _length + ")."); - break; } // otherwise, we've filled up our buffer as a result of this @@ -119,6 +107,12 @@ public class FramedInputStream extends InputStream // don't let things grow without bounds } while (_buffer.capacity() < MAX_BUFFER_CAPACITY); + // if we didn't already have our length, see if we now have enough + // data to obtain it + if (_length == -1) { + _length = decodeLength(); + } + // finally check to see if there's a complete frame in the buffer // and prepare to serve it up if there is return checkForCompleteFrame();