From c5c40ae481901606d6971d6588289d2003b8d800 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 20 Apr 2011 05:40:25 +0000 Subject: [PATCH] Removed obsolete boot_node_foo_listen_port, you can now customize it in config-local.php --- application/hub/config-local.php-dist | 6 ----- application/hub/config.php | 6 ----- .../hub/main/nodes/boot/class_HubBootNode.php | 2 +- .../hub/main/nodes/class_BaseHubNode.php | 26 +++++++++---------- 4 files changed, 13 insertions(+), 27 deletions(-) diff --git a/application/hub/config-local.php-dist b/application/hub/config-local.php-dist index 4cbdceeb3..b3fcab65c 100644 --- a/application/hub/config-local.php-dist +++ b/application/hub/config-local.php-dist @@ -45,12 +45,6 @@ $cfg->setConfigEntry('node_tcp_listen_port', 9060); // CFG: NODE-UDP-LISTEN-PORT $cfg->setConfigEntry('node_udp_listen_port', 9060); -// CFG: BOOT-NODE-TCP-LISTEN-PORT -$cfg->setConfigEntry('boot_node_tcp_listen_port', 9061); - -// CFG: BOOT-NODE-UDP-LISTEN-PORT -$cfg->setConfigEntry('boot_node_udp_listen_port', 9061); - // CFG: NODE-DEFAULT-MODE (can be 'regular', 'list', 'master' or 'boot', default is 'regular') $cfg->setConfigEntry('node_default_mode', 'regular'); diff --git a/application/hub/config.php b/application/hub/config.php index d359fd85e..3264f81f6 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -33,12 +33,6 @@ $cfg->setConfigEntry('node_tcp_listen_port', 9060); // CFG: NODE-UDP-LISTEN-PORT $cfg->setConfigEntry('node_udp_listen_port', 9060); -// CFG: BOOT-NODE-TCP-LISTEN-PORT -$cfg->setConfigEntry('boot_node_tcp_listen_port', 9061); - -// CFG: BOOT-NODE-UDP-LISTEN-PORT -$cfg->setConfigEntry('boot_node_udp_listen_port', 9061); - // CFG: NODE-DEFAULT-MODE (can be 'regular', 'list', 'master' or 'boot', default is 'regular') $cfg->setConfigEntry('node_default_mode', 'regular'); diff --git a/application/hub/main/nodes/boot/class_HubBootNode.php b/application/hub/main/nodes/boot/class_HubBootNode.php index 9b7de3925..28ba84eb0 100644 --- a/application/hub/main/nodes/boot/class_HubBootNode.php +++ b/application/hub/main/nodes/boot/class_HubBootNode.php @@ -61,7 +61,7 @@ class HubBootNode extends BaseHubNode implements NodeHelper, Registerable { // Now check if the IP address matches one of the bootstrap nodes if ($this->ifAddressMatchesBootstrappingNodes($this->getConfigInstance()->detectServerAddress())) { // Get our port from configuration - $ourPort = $this->getConfigInstance()->getConfigEntry('boot_node_tcp_listen_port'); + $ourPort = $this->getConfigInstance()->getConfigEntry('node_tcp_listen_port'); // Extract port $bootPort = substr($this->getBootIpPort(), -strlen($ourPort), strlen($ourPort)); diff --git a/application/hub/main/nodes/class_BaseHubNode.php b/application/hub/main/nodes/class_BaseHubNode.php index c312de2bc..eace6673e 100644 --- a/application/hub/main/nodes/class_BaseHubNode.php +++ b/application/hub/main/nodes/class_BaseHubNode.php @@ -523,13 +523,12 @@ class BaseHubNode extends BaseHubSystem implements Updateable { // Setup address and port $listenerInstance->setListenAddressByConfiguration('node_listen_addr'); - if ($this instanceof HubBootNode) { - // Bootstrap have different listening port - $listenerInstance->setListenPortByConfiguration('boot_node_tcp_listen_port'); - } else { - // All other nodes use the default port - $listenerInstance->setListenPortByConfiguration('node_tcp_listen_port'); - } + + /* + * All nodes can now use the same configuration entry because it can be + * customized in config-local.php. + */ + $listenerInstance->setListenPortByConfiguration('node_tcp_listen_port'); // Initialize the listener $listenerInstance->initListener(); @@ -551,13 +550,12 @@ class BaseHubNode extends BaseHubSystem implements Updateable { // Setup address and port $listenerInstance->setListenAddressByConfiguration('node_listen_addr'); - if ($this instanceof HubBootNode) { - // Bootstrap have different listening port - $listenerInstance->setListenPortByConfiguration('boot_node_udp_listen_port'); - } else { - // All other nodes use the default port - $listenerInstance->setListenPortByConfiguration('node_udp_listen_port'); - } + + /* + * All nodes can now use the same configuration entry because it can be + * customized in config-local.php. + */ + $listenerInstance->setListenPortByConfiguration('node_udp_listen_port'); // Initialize the listener $listenerInstance->initListener(); -- 2.39.5