diff --git a/dist/dhcp/server.js b/dist/dhcp/server.js index b4700f7..4edcb9a 100644 --- a/dist/dhcp/server.js +++ b/dist/dhcp/server.js @@ -32,7 +32,7 @@ Server = (function(superClass) { function Server(config) { var sock, sock6; - Server.__super__.constructor.apply(this, arguments); + Server.__super__.constructor.call(this); sock = dgram.createSocket({ type: 'udp4', reuseAddr: true diff --git a/dist/http/cwmp/xml.js b/dist/http/cwmp/xml.js index 1761073..5b9bd0a 100644 --- a/dist/http/cwmp/xml.js +++ b/dist/http/cwmp/xml.js @@ -101,7 +101,7 @@ exports.parse = function(xml) { ); }; -methods = { +exports.methods = methods = { 'cwmp:TransferCompleteResponse': function(res) { var h, i, ref, w; i = 0; diff --git a/dist/port.js b/dist/port.js new file mode 100644 index 0000000..d7f0a3d --- /dev/null +++ b/dist/port.js @@ -0,0 +1,19 @@ +var net; + +net = require('net'); + +module.exports = function() { + return new Promise(function(resolve, reject) { + var server; + server = net.createServer(); + server.unref(); + server.on('error', reject); + return server.listen(0, function() { + var port; + port = server.address().port; + return server.close(function() { + return resolve(port); + }); + }); + }); +}; diff --git a/package.json b/package.json index a54d0ea..fd9e02d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tch-exploit", - "version": "2.0.0-b2", + "version": "2.0.0-b3", "main": "dist/index.js", "bin": "dist/index.js", "scripts": { diff --git a/src/http/cwmp/xml.coffee b/src/http/cwmp/xml.coffee index b7f10b7..893cda5 100644 --- a/src/http/cwmp/xml.coffee +++ b/src/http/cwmp/xml.coffee @@ -92,7 +92,7 @@ exports.parse = (xml) -> "#{name}": obj -export.methods = methods = +exports.methods = methods = 'cwmp:TransferCompleteResponse': (res) -> i = 0