diff --git a/editor/js/nodes.js b/editor/js/nodes.js index c227d1856..cdd1dfae7 100644 --- a/editor/js/nodes.js +++ b/editor/js/nodes.js @@ -896,7 +896,7 @@ RED.nodes = (function() { } - if (!existingConfigNode) { //} || !compareNodes(existingConfigNode,n,true) || existingConfigNode._def.exclusive || existingConfigNode.z !== n.z) { + if (!existingConfigNode || existingConfigNode._def.exclusive) { //} || !compareNodes(existingConfigNode,n,true) || existingConfigNode.z !== n.z) { configNode = {id:n.id, z:n.z, type:n.type, users:[], _config:{}}; for (d in def.defaults) { if (def.defaults.hasOwnProperty(d)) { diff --git a/nodes/core/core/75-exec.html b/nodes/core/core/75-exec.html index 713cd9699..8d9d167f8 100644 --- a/nodes/core/core/75-exec.html +++ b/nodes/core/core/75-exec.html @@ -115,6 +115,7 @@ the type of signal to be sent, for example, SIGINT, SIGQUIT or SIGHUP. Defaults to SIGTERM if set to an empty string.

If the node has more than one process running then msg.pid must also be set with the value of the PID to be killed.

+

If a value is provided in the Timeout field then, if the process has not completed when the specified number of seconds has elapsed, the process will be killed automatically

Tip: if running a Python app you may need to use the -u parameter to stop the output being buffered.

diff --git a/nodes/core/io/32-udp.js b/nodes/core/io/32-udp.js index afebc6062..fac5135cf 100644 --- a/nodes/core/io/32-udp.js +++ b/nodes/core/io/32-udp.js @@ -125,8 +125,8 @@ module.exports = function(RED) { if (process.version.indexOf("v0.10") === 0) { opts = node.ipv; } var sock; - if (udpInputPortsInUse[this.outport]) { - sock = udpInputPortsInUse[this.outport]; + if (udpInputPortsInUse[this.outport || this.port]) { + sock = udpInputPortsInUse[this.outport || this.port]; } else { sock = dgram.createSocket(opts); // default to udp4 @@ -136,7 +136,7 @@ module.exports = function(RED) { // prevent it going to the global error handler and shutting node-red // down. }); - udpInputPortsInUse[this.outport] = sock; + udpInputPortsInUse[this.outport || this.port] = sock; } if (node.multicast != "false") { @@ -161,7 +161,7 @@ module.exports = function(RED) { node.log(RED._("udp.status.bc-ready",{outport:node.outport,host:node.addr,port:node.port})); } }); - } else if ((node.outport !== "") && (!udpInputPortsInUse[this.outport])) { + } else if ((node.outport !== "") && (!udpInputPortsInUse[node.outport])) { sock.bind(node.outport); node.log(RED._("udp.status.ready",{outport:node.outport,host:node.addr,port:node.port})); } else { @@ -198,8 +198,8 @@ module.exports = function(RED) { }); node.on("close", function() { - if (udpInputPortsInUse.hasOwnProperty(node.outport)) { - delete udpInputPortsInUse[node.outport]; + if (udpInputPortsInUse.hasOwnProperty(node.outport || node.port)) { + delete udpInputPortsInUse[node.outport || node.port]; } try { sock.close(); diff --git a/red/red.js b/red/red.js index 5ca42050a..7aec5750a 100644 --- a/red/red.js +++ b/red/red.js @@ -69,13 +69,21 @@ module.exports = { runtime.init(userSettings,api); api.init(httpServer,runtime); apiEnabled = true; + server = runtime.adminApi.server; + runtime.server = runtime.adminApi.server; } else { runtime.init(userSettings); apiEnabled = false; + if (httpServer){ + server = httpServer; + runtime.server = httpServer; + } else { + server = runtime.adminApi.server; + runtime.server = runtime.adminApi.server; // useless at this point, but at least harmless. + } } adminApp = runtime.adminApi.adminApp; nodeApp = runtime.nodeApp; - server = runtime.adminApi.server; return; }, start: function() { diff --git a/red/runtime/nodes/registry/loader.js b/red/runtime/nodes/registry/loader.js index 4dbd62736..3592d623a 100644 --- a/red/runtime/nodes/registry/loader.js +++ b/red/runtime/nodes/registry/loader.js @@ -84,7 +84,7 @@ function createNodeApi(node) { red.auth = runtime.adminApi.auth; red.httpAdmin = runtime.adminApi.adminApp; red.httpNode = runtime.nodeApp; - red.server = runtime.adminApi.server; + red.server = runtime.server; } else { //TODO: runtime.adminApi is always stubbed if not enabled, so this block // is unused - but may be needed for the unit tests