/[LeafOK_CVS]/lbbs/src/net_server.c
ViewVC logotype

Diff of /lbbs/src/net_server.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.36 by sysadm, Sat May 17 05:56:17 2025 UTC Revision 1.40 by sysadm, Sun May 25 08:10:48 2025 UTC
# Line 129  int net_server(const char *hostaddr, in_ Line 129  int net_server(const char *hostaddr, in_
129                          sd_notify(0, "STOPPING=1");                          sd_notify(0, "STOPPING=1");
130                          sd_notify_stopping = 1;                          sd_notify_stopping = 1;
131                  }                  }
132    
133                  while ((SYS_child_exit || SYS_server_exit) && SYS_child_process_count > 0)                  while ((SYS_child_exit || SYS_server_exit) && SYS_child_process_count > 0)
134                  {                  {
135                          SYS_child_exit = 0;                          SYS_child_exit = 0;
# Line 167  int net_server(const char *hostaddr, in_ Line 168  int net_server(const char *hostaddr, in_
168                  if (SYS_menu_reload && !SYS_server_exit)                  if (SYS_menu_reload && !SYS_server_exit)
169                  {                  {
170                          SYS_menu_reload = 0;                          SYS_menu_reload = 0;
171                            sd_notify(0, "RELOADING=1");
172    
173                          p_bbs_menu_new = calloc(1, sizeof(MENU_SET));                          p_bbs_menu_new = calloc(1, sizeof(MENU_SET));
174                          if (p_bbs_menu_new == NULL)                          if (p_bbs_menu_new == NULL)
# Line 177  int net_server(const char *hostaddr, in_ Line 179  int net_server(const char *hostaddr, in_
179                          {                          {
180                                  unload_menu(p_bbs_menu_new);                                  unload_menu(p_bbs_menu_new);
181                                  free(p_bbs_menu_new);                                  free(p_bbs_menu_new);
182                                    p_bbs_menu_new = NULL;
183    
184                                  log_error("Reload menu failed\n");                                  log_error("Reload menu failed\n");
185                          }                          }
186                          else                          else
187                          {                          {
188                                  unload_menu_shm(p_bbs_menu_new);                                  log_std("Debug: trie dict nodes used = %d, limit = %d\n", trie_dict_used_nodes(), TRIE_NODE_PER_POOL);
189    
190                                  unload_menu(p_bbs_menu);                                  unload_menu(p_bbs_menu);
191                                  free(p_bbs_menu);                                  free(p_bbs_menu);
# Line 192  int net_server(const char *hostaddr, in_ Line 195  int net_server(const char *hostaddr, in_
195    
196                                  log_std("Reload menu successfully\n");                                  log_std("Reload menu successfully\n");
197                          }                          }
198    
199                            sd_notify(0, "READY=1");
200                  }                  }
201    
202                  if (SYS_data_file_reload && !SYS_server_exit)                  if (SYS_data_file_reload && !SYS_server_exit)
203                  {                  {
204                          SYS_data_file_reload = 0;                          SYS_data_file_reload = 0;
205                            sd_notify(0, "RELOADING=1");
206    
207                          for (int i = 0; i < data_files_load_startup_count; i++)                          for (int i = 0; i < data_files_load_startup_count; i++)
208                          {                          {
209                                  if (load_file_shm(data_files_load_startup[i]) < 0)                                  if (load_file(data_files_load_startup[i]) < 0)
210                                  {                                  {
211                                          log_error("load_file_mmap(%s) error\n", data_files_load_startup[i]);                                          log_error("load_file_mmap(%s) error\n", data_files_load_startup[i]);
212                                  }                                  }
213                          }                          }
214    
215                          log_std("Reload data files successfully\n");                          log_std("Reload data files successfully\n");
216                            sd_notify(0, "READY=1");
217                  }                  }
218    
219                  nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second                  nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1