]> git.meshlink.io Git - meshlink/blobdiff - src/net.c
Remove pidfile/logfile/netname and so on.
[meshlink] / src / net.c
index ae821015d5bd4288647944abdc0a1cbf220df156..cae8629881e79ec3d3ebd620b7feebf1e84ca57a 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -28,7 +28,6 @@
 #include "graph.h"
 #include "logger.h"
 #include "meta.h"
-#include "names.h"
 #include "net.h"
 #include "netutl.h"
 #include "protocol.h"
@@ -41,6 +40,9 @@ time_t last_config_check = 0;
 static timeout_t pingtimer;
 static timeout_t periodictimer;
 
+//TODO: move this to a better place
+char *confbase;
+
 /* Purge edges of unreachable nodes. Use carefully. */
 
 // TODO: remove
@@ -136,9 +138,6 @@ void terminate_connection(connection_t *c, bool report) {
 */
 static void timeout_handler(void *data) {
        for list_each(connection_t, c, connection_list) {
-               if(c->status.control)
-                       continue;
-
                if(c->last_ping_time + pingtimeout <= now.tv_sec) {
                        if(c->status.active) {
                                if(c->status.pinged) {
@@ -189,7 +188,7 @@ static void periodic_handler(void *data) {
                /* Count number of active connections */
                int nc = 0;
                for list_each(connection_t, c, connection_list) {
-                       if(c->status.active && !c->status.control)
+                       if(c->status.active)
                                nc++;
                }
 
@@ -236,7 +235,7 @@ static void periodic_handler(void *data) {
                        int i = 0;
 
                        for list_each(connection_t, c, connection_list) {
-                               if(!c->status.active || c->status.control)
+                               if(!c->status.active)
                                        continue;
 
                                if(i++ != r)
@@ -291,7 +290,6 @@ static void sigterm_handler(void *data) {
 
 static void sighup_handler(void *data) {
        logger(DEBUG_ALWAYS, LOG_NOTICE, "Got %s signal", strsignal(((signal_t *)data)->signum));
-       reopenlogger();
        if(reload_configuration())
                exit(1);
 }
@@ -332,9 +330,6 @@ int reload_configuration(void) {
        /* Close connections to hosts that have a changed or deleted host config file */
 
        for list_each(connection_t, c, connection_list) {
-               if(c->status.control)
-                       continue;
-
                xasprintf(&fname, "%s" SLASH "hosts" SLASH "%s", confbase, c->name);
                struct stat s;
                if(stat(fname, &s) || s.st_mtime > last_config_check) {