Commit 645fa0ba authored by Claes Sjofors's avatar Claes Sjofors

rt_sevhistmon, bugfix in connect request

parent 9c7853ed
...@@ -615,11 +615,22 @@ int rt_sevhistmon::send_data() ...@@ -615,11 +615,22 @@ int rt_sevhistmon::send_data()
int stime; int stime;
pwr_tTime current_time; pwr_tTime current_time;
pwr_tStatus conf_sts = SEV__SUCCESS; pwr_tStatus conf_sts = SEV__SUCCESS;
int connected;
for ( unsigned int i = 0; i < m_hs.size(); i++) { for ( unsigned int i = 0; i < m_hs.size(); i++) {
if ( m_hs[i].configerror) if ( m_hs[i].configerror)
continue; continue;
connected = 0;
for ( unsigned int j = 0; j < m_nodes.size(); j++) {
if ( m_hs[i].nid == m_nodes[j].nid) {
connected = m_nodes[j].connected;
break;
}
}
if ( !connected)
continue;
stime = int(m_hs[i].scantime / m_scantime + 0.5); stime = int(m_hs[i].scantime / m_scantime + 0.5);
if ( !stime || m_loopcnt % stime != 0) if ( !stime || m_loopcnt % stime != 0)
continue; continue;
...@@ -732,16 +743,9 @@ int rt_sevhistmon::retry_connect() ...@@ -732,16 +743,9 @@ int rt_sevhistmon::retry_connect()
pwr_tStatus sts; pwr_tStatus sts;
for ( unsigned int i = 0; i < m_nodes.size(); i++) { for ( unsigned int i = 0; i < m_nodes.size(); i++) {
if ( m_nodes[i].is_server && !m_nodes[i].connected)
if ( m_nodes[i].is_server && !m_nodes[i].connected) {
m_nodes[i].ctime += m_scantime;
if ( m_nodes[i].ctime > 60) {
m_nodes[i].ctime = 0;
send_connect( m_nodes[i].nid, &sts); send_connect( m_nodes[i].nid, &sts);
} }
}
}
return 1; return 1;
} }
...@@ -878,6 +882,7 @@ int rt_sevhistmon::send_itemlist( pwr_tNid nid) ...@@ -878,6 +882,7 @@ int rt_sevhistmon::send_itemlist( pwr_tNid nid)
if ( nid == m_nodes[i].nid) { if ( nid == m_nodes[i].nid) {
found = true; found = true;
m_nodes[i].connected = 1; m_nodes[i].connected = 1;
printf( "rt_sevhistmon: node %s connected\n", m_nodes[i].name);
break; break;
} }
} }
...@@ -1012,6 +1017,7 @@ int rt_sevhistmon::send_itemlist( pwr_tNid nid) ...@@ -1012,6 +1017,7 @@ int rt_sevhistmon::send_itemlist( pwr_tNid nid)
if ( !m_allconnected) { if ( !m_allconnected) {
bool all_conn = true; bool all_conn = true;
for ( unsigned int i = 0; i < m_nodes.size(); i++) { for ( unsigned int i = 0; i < m_nodes.size(); i++) {
printf( "Sev %s %d %d\n", m_nodes[i].name, m_nodes[i].is_server, m_nodes[i].connected);
if ( m_nodes[i].is_server && !m_nodes[i].connected) { if ( m_nodes[i].is_server && !m_nodes[i].connected) {
all_conn = false; all_conn = false;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment