Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing a bug and small cleanup.

  • Loading branch information...
commit fd6c944dd7901e51a50452191ee204c1715d2329 1 parent 1f87fc2
@gimite gimite authored
View
BIN  WebSocketMain.swf
Binary file not shown
View
BIN  WebSocketMainInsecure.zip
Binary file not shown
View
8 flash-src/WebSocket.as
@@ -279,15 +279,13 @@ public class WebSocket extends EventDispatcher {
}
buffer.position = 1;
var data:String = "";
- for(var i:int = 1, zeroByte:String = String.fromCharCode(0x00); i <= pos; i++) {
+ for(var i:int = 1; i < pos; i++) {
if (buffer[i] == 0x00) {
- data += buffer.readUTFBytes(pos - buffer.position) + zeroByte;
+ data += buffer.readUTFBytes(i - buffer.position) + "\x00";
buffer.position = i + 1;
-
- } else if (buffer[i] == 0xff) {
- data += buffer.readUTFBytes(buffer.bytesAvailable - 1);
}
}
+ data += buffer.readUTFBytes(pos - buffer.position);
main.log("received: " + data);
dataQueue.push(encodeURIComponent(data));
dispatchEvent(new Event("message"));
Please sign in to comment.
Something went wrong with that request. Please try again.