Commit 1bfee4eb authored by Leigh B. Stoller's avatar Leigh B. Stoller

A minor ("30" minute) hack to support widearea keepalive. If a remote

node connects with UDP, update the nodes table status with 'up' and the
current time. This is the only thing that can happen when a remote
node connects with UDP (since there is no ssl). The idea is that a
daemon on the remote nodes will wake up periodically and send in a UDP
packet that says its alive. Since the idea is to be low overhead, I'm
using a UDP packet for now, which means I can run it fairly often on
all the clients, without it being too much of a drain. By its nature,
if the remote node can start up tmcc and get a udp packet out, its
probably in good shape. Maybe we will find out this does not work, but
if so I will have lost only "30 minutes". See related changes in
db/node_status.in.

Also, add the code that kicks out remote nodes that connect with tcp
but no ssl (it was commented out while I originally updated the ron
nodes with the new tmcc stuff).
parent adc366c1
......@@ -563,24 +563,37 @@ handle_request(int sock, struct sockaddr_in *client, char *rdata, int istcp)
}
}
else if (!islocal) {
if (!istcp) {
/*
* Simple "isalive" support for remote nodes.
* Update timestamp, but let someone else worry
* about what it means.
*/
mydb_update("update nodes "
"set status='up',status_timestamp=now() "
"where node_id='%s'", nodeid);
client_writeback(sock, "\n", strlen("\n"), istcp);
goto skipit;
}
error("%s: Remote node connected without SSL!\n", nodeid);
/*
* Allow for now, until ron nodes updated.
* if (! redirect)
* goto skipit;
*/
goto skipit;
}
#else
/*
* When not compiled for ssl, do not allow remote connections.
*/
if (!islocal) {
error("%s: Remote node without SSL!\n", nodeid);
/*
* Allow for now, until ron nodes updated.
* if (! redirect)
* goto skipit;
*/
if (!istcp) {
/*
* Simple "isup" daemon support!
*/
mydb_update("update nodes set status='up' "
"where node_id='%s'", nodeid);
client_writeback(sock, "\n", strlen("\n"), istcp);
goto skipit;
}
error("%s: Remote node connected without SSL!\n", nodeid);
goto skipit;
}
#endif
/*
......
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