summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 822c6c9)
raw | patch | inline | side by side (parent: 822c6c9)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 21 Apr 2014 18:23:15 +0000 (20:23 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 21 Apr 2014 18:23:15 +0000 (20:23 +0200) |
By using the new sdb_fe_sock_clear_listeners(), the list of active listeners
may be reconfigured without affecting any open connections.
may be reconfigured without affecting any open connections.
src/tools/sysdbd/main.c | patch | blob | history |
index 4a4d55ec0ec9eb6e57abb7dcd501be923c0f8c86..3be49381e43f2bc37686b01ae60672e58e2baef2 100644 (file)
--- a/src/tools/sysdbd/main.c
+++ b/src/tools/sysdbd/main.c
static int
main_loop(void)
{
+ sdb_fe_socket_t *sock = sdb_fe_sock_create();
+
pthread_t backend_thread;
while (42) {
break;
}
- sdb_fe_socket_t *sock = sdb_fe_sock_create();
for (i = 0; i < listen_addresses_num; ++i)
if (sdb_fe_sock_add_listener(sock, listen_addresses[i]))
break;
* and make the thread shut down faster */
pthread_kill(backend_thread, SIGINT);
pthread_join(backend_thread, NULL);
- sdb_fe_sock_destroy(sock);
if (! reconfigure)
break;
reconfigure = 0;
+ sdb_fe_sock_clear_listeners(sock);
if (do_reconfigure()) {
sdb_log(SDB_LOG_ERR, "Reconfiguration failed");
break;
}
}
+
+ sdb_fe_sock_destroy(sock);
return 0;
} /* main_loop */