| 25 |
#include "fork.h" |
#include "fork.h" |
| 26 |
#include "menu.h" |
#include "menu.h" |
| 27 |
#include "file_loader.h" |
#include "file_loader.h" |
| 28 |
|
#include "section_list_loader.h" |
| 29 |
#include <errno.h> |
#include <errno.h> |
| 30 |
#include <fcntl.h> |
#include <fcntl.h> |
| 31 |
#include <string.h> |
#include <string.h> |
| 186 |
} |
} |
| 187 |
else |
else |
| 188 |
{ |
{ |
|
log_std("Debug: trie dict nodes used = %d, limit = %d\n", trie_dict_used_nodes(), TRIE_NODE_PER_POOL); |
|
|
|
|
| 189 |
unload_menu(p_bbs_menu); |
unload_menu(p_bbs_menu); |
| 190 |
free(p_bbs_menu); |
free(p_bbs_menu); |
| 191 |
|
|
| 215 |
sd_notify(0, "READY=1"); |
sd_notify(0, "READY=1"); |
| 216 |
} |
} |
| 217 |
|
|
| 218 |
|
if (SYS_section_list_reload && !SYS_server_exit) |
| 219 |
|
{ |
| 220 |
|
SYS_section_list_reload = 0; |
| 221 |
|
|
| 222 |
|
if (section_list_loader_reload() < 0) |
| 223 |
|
{ |
| 224 |
|
log_error("ksection_list_loader_reload() failed\n"); |
| 225 |
|
} |
| 226 |
|
} |
| 227 |
|
|
| 228 |
nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second |
nfds = epoll_wait(epollfd, events, MAX_EVENTS, 100); // 0.1 second |
| 229 |
|
|
| 230 |
if (nfds < 0) |
if (nfds < 0) |
| 274 |
|
|
| 275 |
log_std("Accept connection from %s:%d\n", hostaddr_client, port_client); |
log_std("Accept connection from %s:%d\n", hostaddr_client, port_client); |
| 276 |
|
|
| 277 |
if (fork_server() < 0) |
if (SYS_child_process_count - 1 < BBS_max_client) |
| 278 |
|
{ |
| 279 |
|
if (fork_server() < 0) |
| 280 |
|
{ |
| 281 |
|
log_error("fork_server() error\n"); |
| 282 |
|
} |
| 283 |
|
} |
| 284 |
|
else |
| 285 |
{ |
{ |
| 286 |
log_error("fork_server() error\n"); |
log_error("Rejected client connection over limit (%d)\n", SYS_child_process_count - 1); |
| 287 |
} |
} |
| 288 |
|
|
| 289 |
if (close(socket_client) == -1) |
if (close(socket_client) == -1) |