GUAC-919: Remove SessionKeepAlive (not needed without HttpSession). Consider sessions to be active so long as they have associated tunnels.

This commit is contained in:
Michael Jumper
2014-11-01 23:54:13 -07:00
parent 6fee9cb580
commit 2c476d4d72
7 changed files with 95 additions and 140 deletions

View File

@@ -1199,11 +1199,6 @@ GuacUI.Client.connect = function() {
connect_string += "&video=" + encodeURIComponent(mimetype);
});
// Ping server occasionally to keep HTTP session alive
var session_keep_alive = window.setInterval(function _session_keep_alive() {
GuacamoleService.KeepAlive.ping();
}, GuacUI.Client.KEEP_ALIVE_INTERVAL);
// Show connection errors from tunnel
tunnel.onerror = function(status) {
var message = GuacUI.Client.tunnel_errors[status.code] || GuacUI.Client.tunnel_errors.DEFAULT;
@@ -1216,13 +1211,11 @@ GuacUI.Client.connect = function() {
// Handle disconnect
if (state === Guacamole.Tunnel.State.CLOSED) {
// No need for a keep-alive ping if the tunnel is closed
window.clearInterval(session_keep_alive);
// Notify of disconnections (if not already notified of something else)
if (!GuacUI.Client.visibleStatus)
GuacUI.Client.showStatus("Disconnected",
"You have been disconnected. Reload the page to reconnect.");
}
};

View File

@@ -1056,29 +1056,6 @@ GuacamoleService.Clipboard = {
};
/**
* Collection of service functions which deal with the session keep-alive. Each
* function makes an explicit HTTP query to the server. In the case of the
* keep-alive ping, no response is expected, and any received response is
* ignored.
*/
GuacamoleService.KeepAlive = {
"ping" : function() {
// Construct request URL
var ping_url = "api/keep-alive"
+ "?token=" + GuacamoleService.Auth.current().authToken;
// Send keep-alive "ping"
var xhr = new XMLHttpRequest();
xhr.open("GET", ping_url, true);
xhr.send(null);
}
};
/**
* Collection of service functions which deal with authentication. Note that,
* unlike everything else here, not all functions in GuacamoleService.Auth