1
0
Fork 0

removed SYS_TEST_PORT from global namespace

This commit is contained in:
Frank Celler 2014-03-20 23:04:53 +01:00
parent e25945aaba
commit 11fb42e722
4 changed files with 25 additions and 15 deletions

View File

@ -1,5 +1,5 @@
/*jslint indent: 2, nomen: true, maxlen: 140, sloppy: true, vars: true, white: true, plusplus: true, evil: true */
/*global require, exports, module, SYS_CLUSTER_TEST, SYS_TEST_PORT, ArangoServerState, ArangoClusterComm, ArangoClusterInfo */
/*global require, exports, module, SYS_CLUSTER_TEST, ArangoServerState, ArangoClusterComm, ArangoClusterInfo */
////////////////////////////////////////////////////////////////////////////////
/// @brief cluster actions
@ -580,7 +580,7 @@ actions.defineHttp({
return;
}
try {
var r = SYS_TEST_PORT("tcp://0.0.0.0:"+port);
var r = internal.testPort("tcp://0.0.0.0:"+port);
res.responseCode = actions.HTTP_OK;
res.contentType = "application/json; charset=utf-8";
res.body = JSON.stringify(r);

View File

@ -20,7 +20,7 @@
BYTES_SENT_DISTRIBUTION, BYTES_RECEIVED_DISTRIBUTION, CONNECTION_TIME_DISTRIBUTION,
REQUEST_TIME_DISTRIBUTION, DEVELOPMENT_MODE, FE_DEVELOPMENT_MODE, THREAD_NUMBER, LOGFILE_PATH,
SYS_PLATFORM, SYS_EXECUTE_EXTERNAL, SYS_STATUS_EXTERNAL, SYS_KILL_EXTERNAL,
SYS_DEFINE_PERIODIC */
SYS_DEFINE_PERIODIC, SYS_TEST_PORT */
////////////////////////////////////////////////////////////////////////////////
/// @brief module "internal"
@ -706,7 +706,7 @@
}
////////////////////////////////////////////////////////////////////////////////
/// @brief creates an external process
/// @brief executeExternal
////////////////////////////////////////////////////////////////////////////////
if (typeof SYS_EXECUTE_EXTERNAL !== "undefined") {
@ -715,7 +715,7 @@
}
////////////////////////////////////////////////////////////////////////////////
/// @brief kills an external process
/// @brief killExternal
////////////////////////////////////////////////////////////////////////////////
if (typeof SYS_KILL_EXTERNAL !== "undefined") {
@ -724,7 +724,7 @@
}
////////////////////////////////////////////////////////////////////////////////
/// @brief checks a status of an external process
/// @brief statusExternal
////////////////////////////////////////////////////////////////////////////////
if (typeof SYS_STATUS_EXTERNAL !== "undefined") {
@ -733,7 +733,7 @@
}
////////////////////////////////////////////////////////////////////////////////
/// @brief defines a period timer
/// @brief definePeriodic
////////////////////////////////////////////////////////////////////////////////
if (typeof SYS_DEFINE_PERIODIC !== "undefined") {
@ -741,6 +741,15 @@
delete SYS_DEFINE_PERIODIC;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief testPort
////////////////////////////////////////////////////////////////////////////////
if (typeof SYS_TEST_PORT !== "undefined") {
exports.testPort = SYS_TEST_PORT;
delete SYS_TEST_PORT;
}
// -----------------------------------------------------------------------------
// --SECTION-- private functions
// -----------------------------------------------------------------------------
@ -1583,7 +1592,7 @@ function printf () {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief turn off pretty printing
/// @brief print_plain
////////////////////////////////////////////////////////////////////////////////
function print_plain () {
@ -1623,7 +1632,7 @@ function print_plain () {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief start pretty printing
/// @brief start_pretty_print
////////////////////////////////////////////////////////////////////////////////
function start_pretty_print () {
@ -1633,7 +1642,7 @@ function start_pretty_print () {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief stop pretty printing
/// @brief stop_pretty_print
////////////////////////////////////////////////////////////////////////////////
function stop_pretty_print () {
@ -1643,7 +1652,7 @@ function stop_pretty_print () {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief start pretty printing with optional color
/// @brief start_color_print
////////////////////////////////////////////////////////////////////////////////
function start_color_print (color) {
@ -1653,7 +1662,7 @@ function start_color_print (color) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief stop pretty printing
/// @brief stop_color_print
////////////////////////////////////////////////////////////////////////////////
function stop_color_print () {

View File

@ -1,5 +1,5 @@
/*jslint indent: 2, nomen: true, maxlen: 120, sloppy: true, vars: true, white: true, plusplus: true, stupid: true */
/*global module, require, exports, ArangoServerState, SYS_TEST_PORT */
/*global module, require, exports, ArangoServerState */
////////////////////////////////////////////////////////////////////////////////
/// @brief Cluster kickstarting functionality using dispatchers

View File

@ -1,5 +1,5 @@
/*jslint indent: 2, nomen: true, maxlen: 120, sloppy: true, vars: true, white: true, plusplus: true, stupid: true */
/*global module, require, exports, ArangoAgency, SYS_TEST_PORT */
/*global module, require, exports, ArangoAgency */
////////////////////////////////////////////////////////////////////////////////
/// @brief Cluster planning functionality
@ -34,6 +34,7 @@
var download = require("internal").download;
var base64Encode = require("internal").base64Encode;
var testPort = require("internal").testPort;
// Our default configurations:
@ -131,7 +132,7 @@ PortFinder.prototype.next = function () {
if (!this.dispatcher.avoidPorts.hasOwnProperty(this.port)) {
var available = true;
if (this.dispatcher.endpoint === "tcp://localhost:") {
available = SYS_TEST_PORT("tcp://0.0.0.0:"+this.port);
available = testPort("tcp://0.0.0.0:"+this.port);
}
else {
var url = "http" + this.dispatcher.endpoint.substr(3) +