Reduced spam

This commit is contained in:
jsrobson10 2019-04-10 13:09:40 +10:00
parent 66e0db11bd
commit 2a326d477f
1 changed files with 11 additions and 11 deletions

View File

@ -196,7 +196,7 @@ function make_encryption_key(string)
key.at.rx = 0; key.at.rx = 0;
key.at.tx = 0; key.at.tx = 0;
console.log("make_encryption_key:", key.str); //console.log("make_encryption_key:", key.str);
// Return the key // Return the key
return key; return key;
@ -204,22 +204,22 @@ function make_encryption_key(string)
function socket_write(socket, encryption, data) function socket_write(socket, encryption, data)
{ {
console.log("socket_write() b4:", data); //console.log("socket_write() b4:", data);
// Convert the data to JSON // Convert the data to JSON
data = JSON.stringify(data); data = JSON.stringify(data);
console.log("socket_write() stringify:", data); //console.log("socket_write() stringify:", data);
// Encrypt the data // Encrypt the data
data = string_encrypt(encryption, data); data = string_encrypt(encryption, data);
console.log("socket_write() encrypt:", data); //console.log("socket_write() encrypt:", data);
// Order the request // Order the request
data = send_ordered(data); data = send_ordered(data);
console.log("socket_write() ordered:", data); //console.log("socket_write() ordered:", data);
// Send the data // Send the data
socket.write(data); socket.write(data);
@ -243,7 +243,7 @@ function connect(hostname, port=22068)
g.rsa_task.stdout.on('data', function(data) g.rsa_task.stdout.on('data', function(data)
{ {
console.log("child stdout:", data.toString()); //console.log("child stdout:", data.toString());
}); });
g.rsa_task.stderr.on('data', function(data) g.rsa_task.stderr.on('data', function(data)
@ -277,7 +277,7 @@ function connect(hostname, port=22068)
function rsa_task_send(data) function rsa_task_send(data)
{ {
console.log("Send to child:", JSON.stringify(data)); //console.log("Send to child:", JSON.stringify(data));
g.rsa_task.send(JSON.stringify(data)); g.rsa_task.send(JSON.stringify(data));
} }
@ -296,12 +296,12 @@ function connect(hostname, port=22068)
// Recieve data in order // Recieve data in order
recieve_ordered(data, function(data) recieve_ordered(data, function(data)
{ {
console.log("RAW: ", { /*console.log("RAW: ", {
input: data, input: data,
sock_new:g.sock_new, sock_new:g.sock_new,
raw_encryption_data_upto: g.raw_encryption_data_upto, raw_encryption_data_upto: g.raw_encryption_data_upto,
bsplit_length: bsplit(data, Buffer.from("\n")).length bsplit_length: bsplit(data, Buffer.from("\n")).length
}); });*/
if(g.sock_new != 0) if(g.sock_new != 0)
{ {
@ -345,7 +345,7 @@ function connect(hostname, port=22068)
g.rsa_task.on('message', function(message) g.rsa_task.on('message', function(message)
{ {
console.log(message) //console.log(message)
// Parse the message from JSON // Parse the message from JSON
var data = JSON.parse(message); var data = JSON.parse(message);
@ -375,7 +375,7 @@ function connect(hostname, port=22068)
// Set the key // Set the key
g.encryption = make_encryption_key(atob(data['out'])); g.encryption = make_encryption_key(atob(data['out']));
console.log("Sending 1:", data['out']); //console.log("Sending 1:", data['out']);
// Send status // Send status
socket_write(client, g.encryption, 1); socket_write(client, g.encryption, 1);