--- lbbs/src/net_server.c 2025/10/25 07:58:10 1.75 +++ lbbs/src/net_server.c 2025/11/11 00:28:05 1.81 @@ -1,21 +1,18 @@ -/*************************************************************************** - net_server.c - description - ------------------- - Copyright : (C) 2004-2025 by Leaflet - Email : leaflet@leafok.com - ***************************************************************************/ - -/*************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * net_server + * - network server with SSH support + * + * Copyright (C) 2004-2025 Leaflet + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "bbs.h" #include "bbs_main.h" +#include "bwf.h" #include "common.h" #include "database.h" #include "file_loader.h" @@ -47,8 +44,13 @@ #include #include -#define WAIT_CHILD_PROCESS_EXIT_TIMEOUT 5 // second -#define WAIT_CHILD_PROCESS_KILL_TIMEOUT 1 // second +enum _net_server_constant_t +{ + WAIT_CHILD_PROCESS_EXIT_TIMEOUT = 5, // second + WAIT_CHILD_PROCESS_KILL_TIMEOUT = 1, // second + + SSH_AUTH_MAX_DURATION = 60 * 1000, // milliseconds +}; struct process_sockaddr_t { @@ -59,9 +61,7 @@ typedef struct process_sockaddr_t PROCES static PROCESS_SOCKADDR process_sockaddr_pool[MAX_CLIENT_LIMIT]; -#define SSH_AUTH_MAX_DURATION (60 * 1000) // milliseconds - -#define SFTP_SERVER_PATH "/usr/lib/sftp-server" +static const char SFTP_SERVER_PATH[] = "/usr/lib/sftp-server"; /* A userdata struct for session. */ struct session_data_struct @@ -658,6 +658,12 @@ int net_server(const char *hostaddr, in_ log_error("Reload conf failed\n"); } + // Reload BWF config + if (bwf_load(CONF_BWF) < 0) + { + log_error("Reload BWF conf failed\n"); + } + if (load_menu(&bbs_menu_new, CONF_MENU) < 0) { unload_menu(&bbs_menu_new); @@ -687,7 +693,7 @@ int net_server(const char *hostaddr, in_ { if (load_file(data_files_load_startup[i]) < 0) { - log_error("load_file_mmap(%s) error\n", data_files_load_startup[i]); + log_error("load_file(%s) error\n", data_files_load_startup[i]); } } log_common("Reload data files successfully\n");