forked from cory/tildefriends
		
	Removed some session cruft.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3379 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		| @@ -1,7 +1,6 @@ | |||||||
| "use strict"; | "use strict"; | ||||||
|  |  | ||||||
| var gSocket; | var gSocket; | ||||||
| var gSessionId; |  | ||||||
| var gCredentials; | var gCredentials; | ||||||
| var gErrorCount = 0; | var gErrorCount = 0; | ||||||
| var gCommandHistory = []; | var gCommandHistory = []; | ||||||
| @@ -111,7 +110,6 @@ function receive(data) { | |||||||
| 		if (line && line.action == "ping") { | 		if (line && line.action == "ping") { | ||||||
| 			gSocket.send(JSON.stringify({action: "pong"})); | 			gSocket.send(JSON.stringify({action: "pong"})); | ||||||
| 		} else if (line && line.action == "session") { | 		} else if (line && line.action == "session") { | ||||||
| 			gSessionId = line.sessionId; |  | ||||||
| 			gCredentials = line.credentials; | 			gCredentials = line.credentials; | ||||||
| 			updateLogin(); | 			updateLogin(); | ||||||
| 		} else if (line && line[0] && line[0].action == "ready") { | 		} else if (line && line[0] && line[0].action == "ready") { | ||||||
|   | |||||||
| @@ -9,6 +9,7 @@ var network = require("network"); | |||||||
|  |  | ||||||
| var gProcessIndex = 0; | var gProcessIndex = 0; | ||||||
| var gProcesses = {}; | var gProcesses = {}; | ||||||
|  | var gSessionIndex = 0; | ||||||
|  |  | ||||||
| var gGlobalSettings = { | var gGlobalSettings = { | ||||||
| 	index: "/~cory/index", | 	index: "/~cory/index", | ||||||
| @@ -35,11 +36,7 @@ function getCookies(headers) { | |||||||
| } | } | ||||||
|  |  | ||||||
| function makeSessionId() { | function makeSessionId() { | ||||||
| 	var id = ""; | 	return (gSessionIndex++).toString(); | ||||||
| 	for (var i = 0; i < 64; i++) { |  | ||||||
| 		id += (Math.floor(Math.random() * 16)).toString(16); |  | ||||||
| 	} |  | ||||||
| 	return id; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| function printError(out, error) { | function printError(out, error) { | ||||||
|   | |||||||
| @@ -160,10 +160,10 @@ function socket(request, response, client) { | |||||||
| 					packageOwner = match[1]; | 					packageOwner = match[1]; | ||||||
| 					packageName = match[2]; | 					packageName = match[2]; | ||||||
| 				} | 				} | ||||||
| 				var sessionId = makeSessionId(); | 				response.send(JSON.stringify({lines: [{action: "session", credentials: credentials}]}), 0x1); | ||||||
| 				response.send(JSON.stringify({lines: [{action: "session", sessionId: sessionId, credentials: credentials}]}), 0x1); |  | ||||||
|  |  | ||||||
| 				options.terminalApi = message.terminalApi || []; | 				options.terminalApi = message.terminalApi || []; | ||||||
|  | 				var sessionId = makeSessionId(); | ||||||
| 				process = await getSessionProcess(packageOwner, packageName, sessionId, options); | 				process = await getSessionProcess(packageOwner, packageName, sessionId, options); | ||||||
| 				process.terminal.readOutput(function(message) { | 				process.terminal.readOutput(function(message) { | ||||||
| 					response.send(JSON.stringify(message), 0x1); | 					response.send(JSON.stringify(message), 0x1); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user