mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
Fixed instruction stream
This commit is contained in:
@@ -295,18 +295,15 @@ function VNCClient(display) {
|
|||||||
|
|
||||||
var nextRequest = null;
|
var nextRequest = null;
|
||||||
|
|
||||||
function startNextRequest() {
|
|
||||||
nextRequest = makeRequest();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start next request in 2 seconds.
|
|
||||||
setTimeout(startNextRequest, 2000);
|
|
||||||
|
|
||||||
var instructionStart = 0;
|
var instructionStart = 0;
|
||||||
var startIndex = 0;
|
var startIndex = 0;
|
||||||
|
|
||||||
function parseResponse() {
|
function parseResponse() {
|
||||||
|
|
||||||
|
// Start next request as soon as possible
|
||||||
|
if (xmlhttprequest.readyState >= 2 && nextRequest == null)
|
||||||
|
nextRequest = makeRequest();
|
||||||
|
|
||||||
// Parse stream when data is received and when complete.
|
// Parse stream when data is received and when complete.
|
||||||
if (xmlhttprequest.readyState == 3 ||
|
if (xmlhttprequest.readyState == 3 ||
|
||||||
xmlhttprequest.readyState == 4) {
|
xmlhttprequest.readyState == 4) {
|
||||||
@@ -379,11 +376,13 @@ function VNCClient(display) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var seq = 0;
|
||||||
|
|
||||||
function makeRequest() {
|
function makeRequest() {
|
||||||
|
|
||||||
// Download self
|
// Download self
|
||||||
var xmlhttprequest = new XMLHttpRequest();
|
var xmlhttprequest = new XMLHttpRequest();
|
||||||
xmlhttprequest.open("GET", "instructions");
|
xmlhttprequest.open("GET", "instructions?seq=" + (seq++));
|
||||||
|
|
||||||
xmlhttprequest.send(null);
|
xmlhttprequest.send(null);
|
||||||
return xmlhttprequest;
|
return xmlhttprequest;
|
||||||
|
Reference in New Issue
Block a user