[pve-devel] [PATCH xtermjs v2] do not try to reconnect the host shell

Dominik Csapak d.csapak at proxmox.com
Mon May 7 15:06:55 CEST 2018


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
* fixed subject (s/to/do/)
* removed unecessary else branch
 src/www/main.js | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/www/main.js b/src/www/main.js
index ac437f8..1081390 100644
--- a/src/www/main.js
+++ b/src/www/main.js
@@ -58,7 +58,7 @@ function updateState(newState, msg) {
 		case states.disconnecting:
 		    var time_since_started = new Date() - starttime;
 		    timeout = 5000;
-		    if (time_since_started > 5*1000) {
+		    if (time_since_started > 5*1000 || type === 'shell') {
 			message = "Connection closed";
 		    } else {
 			message = "Connection failed";
@@ -273,14 +273,9 @@ function checkMigration() {
 function tryReconnect() {
     var time_since_started = new Date() - starttime;
     var type = getQueryParameter('console');
-    if (time_since_started < 5*1000) { // 5 seconds
+    if (time_since_started < 5*1000 || type === 'shell') { // 5 seconds
 	stopTerminal();
 	return;
-    } else if (type === 'shell') {
-	updateState(states.reconnecting, 'trying to reconnect...');
-	setTimeout(function() {
-	    location.reload();
-	}, 1000);
     }
 
     updateState(states.disconnecting, 'Detecting migration...');
-- 
2.11.0





More information about the pve-devel mailing list