| 3 |
* bbs_net |
* bbs_net |
| 4 |
* - user interactive feature of site shuttle |
* - user interactive feature of site shuttle |
| 5 |
* |
* |
| 6 |
* Copyright (C) 2004-2025 by Leaflet <leaflet@leafok.com> |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
|
#ifdef HAVE_CONFIG_H |
| 10 |
|
#include "config.h" |
| 11 |
|
#endif |
| 12 |
|
|
| 13 |
#include "bbs.h" |
#include "bbs.h" |
| 14 |
#include "common.h" |
#include "common.h" |
| 15 |
#include "io.h" |
#include "io.h" |
| 37 |
#include <sys/socket.h> |
#include <sys/socket.h> |
| 38 |
#include <sys/epoll.h> |
#include <sys/epoll.h> |
| 39 |
|
|
| 40 |
#define MENU_CONF_DELIM " \t\r\n" |
static const char MENU_CONF_DELIM[] = " \t\r\n"; |
| 41 |
|
|
| 42 |
#define MAX_PROCESS_BAR_LEN 30 |
enum _bbs_net_constant_t |
| 43 |
#define MAXSTATION 26 * 2 |
{ |
| 44 |
#define STATION_PER_LINE 4 |
MAX_PROCESS_BAR_LEN = 30, |
| 45 |
|
MAXSTATION = 26 * 2, |
| 46 |
|
STATION_PER_LINE = 4, |
| 47 |
|
}; |
| 48 |
|
|
| 49 |
struct _bbsnet_conf |
struct _bbsnet_conf |
| 50 |
{ |
{ |
| 52 |
char host2[40]; |
char host2[40]; |
| 53 |
char ip[40]; |
char ip[40]; |
| 54 |
in_port_t port; |
in_port_t port; |
| 55 |
char charset[20]; |
char charset[CHARSET_MAX_LEN + 1]; |
| 56 |
} bbsnet_conf[MAXSTATION]; |
} bbsnet_conf[MAXSTATION]; |
| 57 |
|
|
| 58 |
static MENU_SET bbsnet_menu; |
static MENU_SET bbsnet_menu; |
| 483 |
} |
} |
| 484 |
else if (nfds == 0) // timeout |
else if (nfds == 0) // timeout |
| 485 |
{ |
{ |
| 486 |
if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME) |
if (time(NULL) - BBS_last_access_tm >= BBS_max_user_idle_time) |
| 487 |
{ |
{ |
| 488 |
break; |
break; |
| 489 |
} |
} |
| 881 |
log_error("KEY_NULL\n"); |
log_error("KEY_NULL\n"); |
| 882 |
goto cleanup; |
goto cleanup; |
| 883 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 884 |
if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME) |
if (time(NULL) - BBS_last_access_tm >= BBS_max_user_idle_time) |
| 885 |
{ |
{ |
| 886 |
log_error("User input timeout\n"); |
log_error("User input timeout\n"); |
| 887 |
goto cleanup; |
goto cleanup; |