]> git.meshlink.io Git - meshlink/commitdiff
Remove reload_configuration().
authorGuus Sliepen <guus@meshlink.io>
Sat, 26 Apr 2014 08:33:35 +0000 (10:33 +0200)
committerGuus Sliepen <guus@meshlink.io>
Sat, 26 Apr 2014 08:33:35 +0000 (10:33 +0200)
This was only useful for tinc, where the admin could change the configuration
files while tincd was running. With MeshLink, everything should be done via the
API.

src/net.c
src/net.h

index f543c207259c049d0886e75120304deecc405a69..61cb1538de42236ee2727ff537b5034df6f4b752 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -268,46 +268,6 @@ void handle_meta_connection_data(connection_t *c) {
        }
 }
 
-int reload_configuration(void) {
-       char filename[PATH_MAX];
-
-       /* Reread our own configuration file */
-
-       exit_configuration(&mesh->config);
-       init_configuration(&mesh->config);
-
-       if(!read_server_config(mesh)) {
-               logger(DEBUG_ALWAYS, LOG_ERR, "Unable to reread configuration file.");
-               return EINVAL;
-       }
-
-       snprintf(filename, PATH_MAX,"%s" SLASH "hosts" SLASH "%s", mesh->confbase, mesh->self->name);
-       read_config_file(mesh->config, filename);
-
-       /* Parse some options that are allowed to be changed while tinc is running */
-
-       setup_myself_reloadable(mesh);
-
-       /* Try to make outgoing connections */
-
-       try_outgoing_connections(mesh);
-
-       /* Close connections to hosts that have a changed or deleted host config file */
-
-       for list_each(connection_t, c, mesh->connections) {
-               snprintf(filename, PATH_MAX,"%s" SLASH "hosts" SLASH "%s", mesh->confbase, c->name);
-               struct stat s;
-               if(stat(filename, &s) || s.st_mtime > mesh->last_config_check) {
-                       logger(DEBUG_CONNECTIONS, LOG_INFO, "Host config file of %s has been changed", c->name);
-                       terminate_connection(c, c->status.active);
-               }
-       }
-
-       mesh->last_config_check = mesh->loop.now.tv_sec;
-
-       return 0;
-}
-
 void retry(void) {
        /* Reset the reconnection timers for all outgoing connections */
        for list_each(outgoing_t, outgoing, mesh->outgoings) {
index 2346149d7827cc3ad4ba77a01a9281156ac68748..843d21807160fd1e5b4ee3007864edeabaddefd8 100644 (file)
--- a/src/net.h
+++ b/src/net.h
@@ -108,7 +108,6 @@ extern void handle_meta_connection_data(struct connection_t *);
 extern void regenerate_key(void);
 extern void purge(void);
 extern void retry(void);
-extern int reload_configuration(void);
 
 #ifndef HAVE_MINGW
 #define closesocket(s) close(s)