Commit 4a961783 authored by Joel Martin's avatar Joel Martin

Better web-socket-js dataQueue reset.

At connect and close time instead of initialization time.
parent 9479c720
......@@ -62,7 +62,6 @@ public class WebSocket extends EventDispatcher {
headers:String = null) {
this.main = main;
initNoiseChars();
dataQueue = [];
this.url = url;
var m:Array = url.match(/^(\w+):\/\/([^\/:]+)(:(\d+))?(\/.*)?$/);
if (!m) main.fatal("SYNTAX_ERR: invalid url: " + url);
......@@ -135,6 +134,7 @@ public class WebSocket extends EventDispatcher {
public function close():void {
main.log("close");
dataQueue = [];
try {
socket.close();
} catch (ex:Error) { }
......@@ -160,6 +160,7 @@ public class WebSocket extends EventDispatcher {
tlsSocket.startTLS(rawSocket, host, tlsConfig);
}
dataQueue = [];
var hostValue:String = host + (port == 80 ? "" : ":" + port);
var cookie:String = "";
if (main.getCallerHost() == host) {
......
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