Skip to content

Commit 56e0d75

Browse files
authored
Merge pull request TooTallNate#470 from zhoulifu/issue465
Fix TooTallNate#465
2 parents b983c88 + 2daee16 commit 56e0d75

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/java_websocket/WebSocketImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ public void decode( ByteBuffer socketBuffer ) {
151151
System.out.println( "process(" + socketBuffer.remaining() + "): {" + ( socketBuffer.remaining() > 1000 ? "too big to display" : new String( socketBuffer.array(), socketBuffer.position(), socketBuffer.remaining() ) ) + "}" );
152152

153153
if( readystate != READYSTATE.NOT_YET_CONNECTED ) {
154-
decodeFrames( socketBuffer );
154+
if ( readystate == READYSTATE.OPEN ) {
155+
decodeFrames( socketBuffer );
156+
}
155157
} else {
156158
if( decodeHandshake( socketBuffer ) ) {
157159
assert ( tmpHandshakeBytes.hasRemaining() != socketBuffer.hasRemaining() || !socketBuffer.hasRemaining() ); // the buffers will never have remaining bytes at the same time

0 commit comments

Comments
 (0)