Commit 7dfa20b8 authored by Joel Martin's avatar Joel Martin

Remove invalid pos check from web-socket-js.

parent 094b489b
...@@ -187,6 +187,7 @@ public class WebSocket extends EventDispatcher { ...@@ -187,6 +187,7 @@ public class WebSocket extends EventDispatcher {
main.log("request header:\n" + req); main.log("request header:\n" + req);
socket.writeUTFBytes(req); socket.writeUTFBytes(req);
main.log("sent key3: " + key3); main.log("sent key3: " + key3);
main.log("expected digest: " + expectedDigest);
writeBytes(key3); writeBytes(key3);
socket.flush(); socket.flush();
} }
...@@ -250,7 +251,6 @@ public class WebSocket extends EventDispatcher { ...@@ -250,7 +251,6 @@ public class WebSocket extends EventDispatcher {
pos = -1; pos = -1;
} }
} else if (headerState == 4) { } else if (headerState == 4) {
if (pos == 15) {
var replyDigest:String = readBytes(buffer, 16); var replyDigest:String = readBytes(buffer, 16);
main.log("reply digest: " + replyDigest); main.log("reply digest: " + replyDigest);
if (replyDigest != expectedDigest) { if (replyDigest != expectedDigest) {
...@@ -263,7 +263,6 @@ public class WebSocket extends EventDispatcher { ...@@ -263,7 +263,6 @@ public class WebSocket extends EventDispatcher {
readyState = OPEN; readyState = OPEN;
notifyStateChange(); notifyStateChange();
dispatchEvent(new Event("open")); dispatchEvent(new Event("open"));
}
} else { } else {
if (buffer[pos] == 0xff) { if (buffer[pos] == 0xff) {
//if (buffer.bytesAvailable > 1) { //if (buffer.bytesAvailable > 1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment