--- lbbs/src/net_server.c 2025/10/29 07:35:05 1.76 +++ lbbs/src/net_server.c 2025/11/07 04:58:09 1.80 @@ -1,21 +1,14 @@ -/*************************************************************************** - 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 + */ #include "bbs.h" #include "bbs_main.h" +#include "bwf.h" #include "common.h" #include "database.h" #include "file_loader.h" @@ -47,8 +40,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 +57,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 +654,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);