/[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.93 by sysadm, Wed Nov 19 04:15:51 2025 UTC Revision 1.95 by sysadm, Fri Nov 21 08:59:29 2025 UTC
# Line 446  static int fork_server(void) Line 446  static int fork_server(void)
446    
447          SYS_child_process_count = 0;          SYS_child_process_count = 0;
448    
449    #ifdef __MSYS__
450            // Load BWF config
451            if (bwf_load(CONF_BWF) < 0)
452            {
453                    log_error("bwf_load() error\n");
454                    goto cleanup;
455            }
456    #endif
457    
458          bbs_main();          bbs_main();
459    
460  cleanup:  cleanup:
# Line 482  cleanup: Line 491  cleanup:
491          ssh_free(SSH_session);          ssh_free(SSH_session);
492          ssh_finalize();          ssh_finalize();
493    
494    #ifdef __MSYS__
495            // Cleanup BWF
496            bwf_unload();
497    #endif
498    
499          // Close Input and Output for client          // Close Input and Output for client
500          io_cleanup();          io_cleanup();
501          close(STDIN_FILENO);          close(STDIN_FILENO);
# Line 511  int net_server(const char *hostaddr, in_ Line 525  int net_server(const char *hostaddr, in_
525          int nfds;          int nfds;
526          int notify_child_exit = 0;          int notify_child_exit = 0;
527          time_t tm_notify_child_exit = time(NULL);          time_t tm_notify_child_exit = time(NULL);
         MENU_SET bbs_menu_new;  
         MENU_SET top10_menu_new;  
528          int i, j;          int i, j;
529          pid_t pid;          pid_t pid;
530          int ssh_log_level = SSH_LOG_NOLOG;          int ssh_log_level = SSH_LOG_NOLOG;
# Line 753  int net_server(const char *hostaddr, in_ Line 765  int net_server(const char *hostaddr, in_
765                                  log_error("Reload conf failed\n");                                  log_error("Reload conf failed\n");
766                          }                          }
767    
768    #ifndef __MSYS__
769                          // Reload BWF config                          // Reload BWF config
770                          if (bwf_load(CONF_BWF) < 0)                          if (bwf_load(CONF_BWF) < 0)
771                          {                          {
772                                  log_error("Reload BWF conf failed\n");                                  log_error("Reload BWF conf failed\n");
773                          }                          }
774    #endif
775    
776                          if (load_menu(&bbs_menu_new, CONF_MENU) < 0)                          if (detach_menu_shm(&bbs_menu) < 0)
777                          {                          {
778                                  unload_menu(&bbs_menu_new);                                  log_error("detach_menu_shm(bbs_menu) error\n");
                                 log_error("Reload bbs menu failed\n");  
779                          }                          }
780                          else                          if (load_menu(&bbs_menu, CONF_MENU) < 0)
781                          {                          {
782                                    log_error("load_menu(bbs_menu) error\n");
783                                  unload_menu(&bbs_menu);                                  unload_menu(&bbs_menu);
                                 memcpy(&bbs_menu, &bbs_menu_new, sizeof(bbs_menu_new));  
                                 log_common("Reload bbs menu successfully\n");  
784                          }                          }
785    
786                          if (load_menu(&top10_menu_new, CONF_TOP10_MENU) < 0)                          if (detach_menu_shm(&top10_menu) < 0)
787                          {                          {
788                                  unload_menu(&top10_menu_new);                                  log_error("detach_menu_shm(top10_menu) error\n");
                                 log_error("Reload top10 menu failed\n");  
789                          }                          }
790                          else                          if (load_menu(&top10_menu, CONF_TOP10_MENU) < 0)
791                          {                          {
792                                    log_error("load_menu(top10_menu) error\n");
793                                  unload_menu(&top10_menu);                                  unload_menu(&top10_menu);
                                 top10_menu_new.allow_exit = 1;  
                                 memcpy(&top10_menu, &top10_menu_new, sizeof(top10_menu_new));  
                                 log_common("Reload top10 menu successfully\n");  
794                          }                          }
795    
796                          for (int i = 0; i < data_files_load_startup_count; i++)                          for (int i = 0; i < data_files_load_startup_count; i++)
# Line 791  int net_server(const char *hostaddr, in_ Line 800  int net_server(const char *hostaddr, in_
800                                          log_error("load_file(%s) error\n", data_files_load_startup[i]);                                          log_error("load_file(%s) error\n", data_files_load_startup[i]);
801                                  }                                  }
802                          }                          }
                         log_common("Reload data files successfully\n");  
803    
804                          // Load section config and gen_ex                          // Load section config and gen_ex
805                          if (load_section_config_from_db(1) < 0)                          if (load_section_config_from_db(1) < 0)
806                          {                          {
807                                  log_error("load_section_config_from_db(1) error\n");                                  log_error("load_section_config_from_db(1) error\n");
808                          }                          }
                         else  
                         {  
                                 log_common("Reload section config and gen_ex successfully\n");  
                         }  
809    
810                          // Notify child processes to reload configuration                          // Notify child processes to reload configuration
811                          if (kill(0, SIGUSR1) < 0)                          if (kill(0, SIGUSR1) < 0)


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

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