[Spread-cvs] commit: r630 - trunk/daemon
jschultz at spread.org
jschultz at spread.org
Mon Jan 6 14:19:50 EST 2014
Author: jschultz
Date: 2014-01-06 14:19:50 -0500 (Mon, 06 Jan 2014)
New Revision: 630
Modified:
trunk/daemon/config_parse.y
trunk/daemon/configuration.c
trunk/daemon/configuration.h
trunk/daemon/membership.c
Log:
Logic for auto-setting use of accelerated ring protocol if it isn't explicitly set in the config file.
Modified: trunk/daemon/config_parse.y
===================================================================
--- trunk/daemon/config_parse.y 2013-12-17 17:17:17 UTC (rev 629)
+++ trunk/daemon/config_parse.y 2014-01-06 19:19:50 UTC (rev 630)
@@ -562,6 +562,7 @@
}
| ACCELERATEDRING EQUALS SP_BOOL
{
+ Conf_set_accelerated_ring_flag(TRUE);
Conf_set_accelerated_ring($3.boolean);
}
| ACCELERATEDWINDOW EQUALS NUMBER
Modified: trunk/daemon/configuration.c
===================================================================
--- trunk/daemon/configuration.c 2013-12-17 17:17:17 UTC (rev 629)
+++ trunk/daemon/configuration.c 2014-01-06 19:19:50 UTC (rev 630)
@@ -106,6 +106,7 @@
static int Window = DEFAULT_WINDOW;
static int PersonalWindow = DEFAULT_PERSONAL_WINDOW;
+static bool AcceleratedRingFlag = FALSE;
static bool AcceleratedRing = FALSE;
static int AcceleratedWindow = 0;
@@ -998,6 +999,16 @@
return PersonalWindow;
}
+void Conf_set_accelerated_ring_flag(bool new_state)
+{
+ AcceleratedRingFlag = new_state;
+}
+
+bool Conf_get_accelerated_ring_flag(void)
+{
+ return AcceleratedRingFlag;
+}
+
void Conf_set_accelerated_ring(bool new_state)
{
AcceleratedRing = new_state;
Modified: trunk/daemon/configuration.h
===================================================================
--- trunk/daemon/configuration.h 2013-12-17 17:17:17 UTC (rev 629)
+++ trunk/daemon/configuration.h 2014-01-06 19:19:50 UTC (rev 630)
@@ -145,6 +145,8 @@
int Conf_get_window(void);
void Conf_set_personal_window(int pwindow);
int Conf_get_personal_window(void);
+void Conf_set_accelerated_ring_flag(bool new_state);
+bool Conf_get_accelerated_ring_flag(void);
void Conf_set_accelerated_ring(bool new_state);
bool Conf_get_accelerated_ring(void);
void Conf_set_accelerated_window(int pwindow);
Modified: trunk/daemon/membership.c
===================================================================
--- trunk/daemon/membership.c 2013-12-17 17:17:17 UTC (rev 629)
+++ trunk/daemon/membership.c 2014-01-06 19:19:50 UTC (rev 630)
@@ -151,20 +151,23 @@
reference_subnet = Cn->segments[0].procs[0]->id;
reference_subnet = reference_subnet & 0xffff0000;
+ Wide_network = 0;
+ for( i=1; i < num_seg; i++ ) {
+ current_subnet = Cn->segments[i].procs[0]->id;
+ current_subnet = current_subnet & 0xffff0000;
+
+ if( current_subnet != reference_subnet ) {
+ Wide_network = 1;
+ break;
+ }
+ }
+
+ if (!Conf_get_accelerated_ring_flag()) {
+ Conf_set_accelerated_ring(!Wide_network);
+ }
+
if (!Conf_memb_timeouts_set()) {
- Wide_network = 0;
- for( i=1; i < num_seg; i++ )
- {
- current_subnet = Cn->segments[i].procs[0]->id;
- current_subnet = current_subnet & 0xffff0000;
- if( current_subnet != reference_subnet )
- {
- Wide_network = 1;
- break;
- }
- }
-
if( Wide_network )
{
Token_timeout.sec = 5; Token_timeout.usec = 0;
More information about the Spread-cvs
mailing list