Fixing invalid statuscode error that shouldn't be thrown on no-status code

This commit is contained in:
Joakim Erdfelt 2012-07-18 12:36:14 -07:00
parent fae2e0d48e
commit b0e475f09c
1 changed files with 2 additions and 1 deletions

View File

@ -37,7 +37,7 @@ public class CloseInfo
public CloseInfo(ByteBuffer payload, boolean validate)
{
this.statusCode = 0;
this.statusCode = -1;
this.reason = null;
if ((payload == null) || (payload.remaining() == 0))
@ -54,6 +54,7 @@ public class CloseInfo
if (data.remaining() >= 2)
{
// Status Code
statusCode = 0; // start with 0
statusCode |= (data.get() & 0xFF) << 8;
statusCode |= (data.get() & 0xFF);