/[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.47 by sysadm, Tue Jun 3 13:27:49 2025 UTC Revision 1.49 by sysadm, Wed Jun 4 13:42:53 2025 UTC
# Line 48  struct process_sockaddr_t Line 48  struct process_sockaddr_t
48  };  };
49  typedef struct process_sockaddr_t PROCESS_SOCKADDR;  typedef struct process_sockaddr_t PROCESS_SOCKADDR;
50    
51  static PROCESS_SOCKADDR process_sockaddr_pool[MAX_CLIENTS_LIMIT];  static PROCESS_SOCKADDR process_sockaddr_pool[MAX_CLIENT_LIMIT];
52    
53  int net_server(const char *hostaddr, in_port_t port)  int net_server(const char *hostaddr, in_port_t port)
54  {  {
# Line 106  int net_server(const char *hostaddr, in_ Line 106  int net_server(const char *hostaddr, in_
106          port_server = ntohs(sin.sin_port);          port_server = ntohs(sin.sin_port);
107          namelen = sizeof(sin);          namelen = sizeof(sin);
108    
109          log_std("Listening at %s:%d\n", hostaddr_server, port_server);          log_common("Listening at %s:%d\n", hostaddr_server, port_server);
110    
111          epollfd = epoll_create1(0);          epollfd = epoll_create1(0);
112          if (epollfd < 0)          if (epollfd < 0)
# Line 155  int net_server(const char *hostaddr, in_ Line 155  int net_server(const char *hostaddr, in_
155                                  SYS_child_exit = 1; // Retry waitid                                  SYS_child_exit = 1; // Retry waitid
156    
157                                  SYS_child_process_count--;                                  SYS_child_process_count--;
158                                  log_std("Child process (%d) exited\n", siginfo.si_pid);                                  log_common("Child process (%d) exited\n", siginfo.si_pid);
159    
160                                  if (siginfo.si_pid != section_list_loader_pid)                                  if (siginfo.si_pid != section_list_loader_pid)
161                                  {                                  {
# Line 187  int net_server(const char *hostaddr, in_ Line 187  int net_server(const char *hostaddr, in_
187    
188                  if (SYS_server_exit && !SYS_child_exit && SYS_child_process_count > 0)                  if (SYS_server_exit && !SYS_child_exit && SYS_child_process_count > 0)
189                  {                  {
190                          log_std("Notify %d child process to exit\n", SYS_child_process_count);                          log_common("Notify %d child process to exit\n", SYS_child_process_count);
191                          if (kill(0, SIGTERM) < 0)                          if (kill(0, SIGTERM) < 0)
192                          {                          {
193                                  log_error("Send SIGTERM signal failed (%d)\n", errno);                                  log_error("Send SIGTERM signal failed (%d)\n", errno);
# Line 228  int net_server(const char *hostaddr, in_ Line 228  int net_server(const char *hostaddr, in_
228                                  p_bbs_menu = p_bbs_menu_new;                                  p_bbs_menu = p_bbs_menu_new;
229                                  p_bbs_menu_new = NULL;                                  p_bbs_menu_new = NULL;
230    
231                                  log_std("Reload menu successfully\n");                                  log_common("Reload menu successfully\n");
232                          }                          }
233    
234                          sd_notify(0, "READY=1");                          sd_notify(0, "READY=1");
# Line 247  int net_server(const char *hostaddr, in_ Line 247  int net_server(const char *hostaddr, in_
247                                  }                                  }
248                          }                          }
249    
250                          log_std("Reload data files successfully\n");                          log_common("Reload data files successfully\n");
251                          sd_notify(0, "READY=1");                          sd_notify(0, "READY=1");
252                  }                  }
253    
# Line 308  int net_server(const char *hostaddr, in_ Line 308  int net_server(const char *hostaddr, in_
308    
309                                          port_client = ntohs(sin.sin_port);                                          port_client = ntohs(sin.sin_port);
310    
311                                          log_std("Accept connection from %s:%d\n", hostaddr_client, port_client);                                          log_common("Accept connection from %s:%d\n", hostaddr_client, port_client);
312    
313                                          if (SYS_child_process_count - 1 < BBS_max_client)                                          if (SYS_child_process_count - 1 < BBS_max_client)
314                                          {                                          {


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

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