diff --git a/meshagent.js b/meshagent.js index 21ddbbf6..59d7d3de 100644 --- a/meshagent.js +++ b/meshagent.js @@ -1671,7 +1671,12 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { if ((tag != null) && (tag.length == 0)) { tag = null; } // If the device is pending a change, hold. - if (obj.deviceChanging === true) { setTimeout(function () { ChangeAgentCoreInfo(command); }, 100); return; } + if (obj.deviceChanging === true) { + var func = function ChangeAgentTagFunc() { ChangeAgentCoreInfo(ChangeAgentTagFunc.cmd); } + func.cmd = command; + setTimeout(func, 100); + return; + } obj.deviceChanging = true; // Get the node and change it if needed diff --git a/webserver.js b/webserver.js index a2e0373f..4f4a31f9 100644 --- a/webserver.js +++ b/webserver.js @@ -3659,7 +3659,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { // Log to recording file if (ws.logfile == null) { // Forward data to the associated TCP connection. - ws.forwardclient.write(data); + try { ws.forwardclient.write(data); } catch (ex) { } } else { // Log to recording file recordingEntry(ws.logfile.fd, 2, 2, data, function () { try { ws.forwardclient.write(data); } catch (ex) { } });