/[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.33 by sysadm, Thu May 15 05:14:57 2025 UTC Revision 1.36 by sysadm, Sat May 17 05:56:17 2025 UTC
# Line 24  Line 24 
24  #include "io.h"  #include "io.h"
25  #include "fork.h"  #include "fork.h"
26  #include "menu.h"  #include "menu.h"
27    #include "file_loader.h"
28  #include <errno.h>  #include <errno.h>
29  #include <fcntl.h>  #include <fcntl.h>
30  #include <string.h>  #include <string.h>
# Line 47  int net_server(const char *hostaddr, in_ Line 48  int net_server(const char *hostaddr, in_
48          int nfds, epollfd;          int nfds, epollfd;
49          siginfo_t siginfo;          siginfo_t siginfo;
50          int sd_notify_stopping = 0;          int sd_notify_stopping = 0;
51            MENU_SET *p_bbs_menu_new;
52    
53          socket_server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);          socket_server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
54    
# Line 166  int net_server(const char *hostaddr, in_ Line 168  int net_server(const char *hostaddr, in_
168                  {                  {
169                          SYS_menu_reload = 0;                          SYS_menu_reload = 0;
170    
171                          unload_menu(p_bbs_menu);                          p_bbs_menu_new = calloc(1, sizeof(MENU_SET));
172                            if (p_bbs_menu_new == NULL)
                         if (load_menu(p_bbs_menu, CONF_MENU) < 0)  
173                          {                          {
174                                  unload_menu(p_bbs_menu);                                  log_error("OOM: calloc(MENU_SET)\n");
175                            }
176                            else if (load_menu(p_bbs_menu_new, CONF_MENU) < 0)
177                            {
178                                    unload_menu(p_bbs_menu_new);
179                                    free(p_bbs_menu_new);
180    
181                                  log_error("Reload menu failed\n");                                  log_error("Reload menu failed\n");
182                          }                          }
183                          else                          else
184                          {                          {
185                                    unload_menu_shm(p_bbs_menu_new);
186    
187                                    unload_menu(p_bbs_menu);
188                                    free(p_bbs_menu);
189    
190                                    p_bbs_menu = p_bbs_menu_new;
191                                    p_bbs_menu_new = NULL;
192    
193                                  log_std("Reload menu successfully\n");                                  log_std("Reload menu successfully\n");
194                          }                          }
195                  }                  }
196    
197                    if (SYS_data_file_reload && !SYS_server_exit)
198                    {
199                            SYS_data_file_reload = 0;
200    
201                            for (int i = 0; i < data_files_load_startup_count; i++)
202                            {
203                                    if (load_file_shm(data_files_load_startup[i]) < 0)
204                                    {
205                                            log_error("load_file_mmap(%s) error\n", data_files_load_startup[i]);
206                                    }
207                            }
208    
209                            log_std("Reload data files successfully\n");
210                    }
211    
212                  nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second                  nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second
213    
214                  if (nfds < 0)                  if (nfds < 0)


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

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