]> arthur.barton.de Git - netdata.git/blobdiff - src/web_server.c
nonzero option should return all selected dimensions if they are all zero; fixes...
[netdata.git] / src / web_server.c
index b0e26283384f85e6a80480494273989dbab41496..8e942a59d549e8dc380447de1f2f5f1753fa1305 100644 (file)
@@ -390,7 +390,7 @@ static inline void cleanup_web_clients(void) {
 #define CLEANUP_EVERY_EVENTS 100
 
 void *socket_listen_main_multi_threaded(void *ptr) {
-    (void)ptr;
+    struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
 
     web_server_mode = WEB_SERVER_MODE_MULTI_THREADED;
     info("Multi-threaded WEB SERVER thread created with task id %d", gettid());
@@ -470,6 +470,10 @@ void *socket_listen_main_multi_threaded(void *ptr) {
     debug(D_WEB_CLIENT, "LISTENER: exit!");
     close_listen_sockets();
 
+    freez(fds);
+
+    static_thread->enabled = 0;
+    pthread_exit(NULL);
     return NULL;
 }
 
@@ -518,7 +522,7 @@ static inline int single_threaded_unlink_client(struct web_client *w, fd_set *if
 }
 
 void *socket_listen_main_single_threaded(void *ptr) {
-    (void)ptr;
+    struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
 
     web_server_mode = WEB_SERVER_MODE_SINGLE_THREADED;
 
@@ -637,5 +641,8 @@ void *socket_listen_main_single_threaded(void *ptr) {
 
     debug(D_WEB_CLIENT, "LISTENER: exit!");
     close_listen_sockets();
+
+    static_thread->enabled = 0;
+    pthread_exit(NULL);
     return NULL;
 }