1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00

removed dead code

This commit is contained in:
Falk Werner 2019-02-15 16:27:40 +01:00
parent b90488678a
commit bff52e9838

View File

@ -1,45 +1,3 @@
function onmessage(message) {
try {
let request = JSON.parse(message.data);
let result = -42;
let response;
console.log(request);
if (("string" === typeof(request.method)) &&
("number" === typeof(request.id)) &&
(request.params)) {
switch(request.method)
{
case "getattr":
result = fs.getattr(request.params[0]);
break;
case "readdir":
result = fs.readdir(request.params[0]);
break;
case "open":
result = fs.open(request.params[0], request.params[1]);
break;
case "read":
result = fs.read(request.params[0], request.params[1], request.params[2]);
break;
default:
break;
}
if ("number" !== typeof(result)) {
response = {result: result, id: request.id};
}
else {
response = {error: {code: result}, id: request.id};
}
console.log(response);
ws.send(JSON.stringify(response));
}
}
catch (ex) { console.log(ex, message); }
};
function startup() {
let connection = new Connection();
let connectionView = new ConnectionView(connection);