+
+ // PICK COMMANDS FROM STREAM
+ do {
+ // CHECK: maybe again here isn't needed
+ again = 0;
+ if (typeof(this.ifra.contentWindow.ctx_new) == 'undefined')
+ break;
+ if (this.ifra.contentWindow.ctx_new.length == this.ctx_old_len) {
+ // this.ctx_new = this.ctx_old = "";
+ // FIXME find a more robust clean method
+ break;
+ }
+ this.log("new: "+ this.ifra.contentWindow.ctx_new.length + " old: "+this.ctx_old_len);
+ this.keepalive_new++;
+ for (i = this.ctx_old_len ; i < this.ifra.contentWindow.ctx_new.length ; i++) {
+ if (this.ifra.contentWindow.ctx_new[i] != '_')
+ break;
+ }
+ if (i == this.ifra.contentWindow.ctx_new.length) {
+ this.ctx_old_len = i;
+ break;
+ }
+ comm_newpart = this.ifra.contentWindow.ctx_new.substr(this.ctx_old_len);
+ comm_len = 0;
+ comm_arr = comm_newpart.match(this.comm_match);
+
+ if (comm_arr) {
+ for (i = 0 ; i < comm_arr.length ; i++) {
+ var temp = comm_arr[i].replace(this.comm_clean,"$1").split("|");
+
+ this.gst.comms = this.gst.comms.concat(temp);
+ // XX alert("COMM_ARR["+i+"]: "+comm_arr[i]+" LEN:"+comm_arr[i].length);
+ comm_len += comm_arr[i].length;
+ }
+ this.ctx_old += comm_newpart.substr(0,comm_len);
+ again = 1;
+ }
+ this.ctx_old_len = this.ctx_old.length;
+ } while (again);