/[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.70 by sysadm, Sun Jun 29 03:32:39 2025 UTC Revision 1.72 by sysadm, Mon Oct 13 07:13:39 2025 UTC
# Line 125  static ssh_channel new_session_channel(s Line 125  static ssh_channel new_session_channel(s
125  static int fork_server(void)  static int fork_server(void)
126  {  {
127          ssh_event event;          ssh_event event;
128            long int ssh_timeout = 0;
129          int pid;          int pid;
130          int i;          int i;
131          int ret;          int ret;
# Line 176  static int fork_server(void) Line 177  static int fork_server(void)
177                  ssh_callbacks_init(&cb);                  ssh_callbacks_init(&cb);
178                  ssh_set_server_callbacks(SSH_session, &cb);                  ssh_set_server_callbacks(SSH_session, &cb);
179    
180                    ssh_timeout = 60; // second
181                    if (ssh_options_set(SSH_session, SSH_OPTIONS_TIMEOUT, &ssh_timeout) < 0)
182                    {
183                            log_error("Error setting SSH options: %s\n", ssh_get_error(SSH_session));
184                            goto cleanup;
185                    }
186    
187                  if (ssh_handle_key_exchange(SSH_session))                  if (ssh_handle_key_exchange(SSH_session))
188                  {                  {
189                          log_error("ssh_handle_key_exchange() error: %s\n", ssh_get_error(SSH_session));                          log_error("ssh_handle_key_exchange() error: %s\n", ssh_get_error(SSH_session));
# Line 201  static int fork_server(void) Line 209  static int fork_server(void)
209                          log_error("SSH auth error, tried %d times\n", cb_data.tries);                          log_error("SSH auth error, tried %d times\n", cb_data.tries);
210                          goto cleanup;                          goto cleanup;
211                  }                  }
212    
213                    ssh_timeout = 0;
214                    if (ssh_options_set(SSH_session, SSH_OPTIONS_TIMEOUT, &ssh_timeout) < 0)
215                    {
216                            log_error("Error setting SSH options: %s\n", ssh_get_error(SSH_session));
217                            goto cleanup;
218                    }
219          }          }
220    
221          // Redirect Input          // Redirect Input
# Line 265  int net_server(const char *hostaddr, in_ Line 280  int net_server(const char *hostaddr, in_
280          time_t tm_notify_child_exit = time(NULL);          time_t tm_notify_child_exit = time(NULL);
281          int sd_notify_stopping = 0;          int sd_notify_stopping = 0;
282          MENU_SET bbs_menu_new;          MENU_SET bbs_menu_new;
283            MENU_SET top10_menu_new;
284          int i, j;          int i, j;
285          pid_t pid;          pid_t pid;
286          int ssh_log_level = SSH_LOG_NOLOG;          int ssh_log_level = SSH_LOG_NOLOG;
# Line 458  int net_server(const char *hostaddr, in_ Line 474  int net_server(const char *hostaddr, in_
474                          if (load_menu(&bbs_menu_new, CONF_MENU) < 0)                          if (load_menu(&bbs_menu_new, CONF_MENU) < 0)
475                          {                          {
476                                  unload_menu(&bbs_menu_new);                                  unload_menu(&bbs_menu_new);
477                                  log_error("Reload menu failed\n");                                  log_error("Reload bbs menu failed\n");
478                          }                          }
479                          else                          else
480                          {                          {
481                                  unload_menu(&bbs_menu);                                  unload_menu(&bbs_menu);
482                                  memcpy(&bbs_menu, &bbs_menu_new, sizeof(bbs_menu_new));                                  memcpy(&bbs_menu, &bbs_menu_new, sizeof(bbs_menu_new));
483                                  log_common("Reload menu successfully\n");                                  log_common("Reload bbs menu successfully\n");
484                            }
485    
486                            if (load_menu(&top10_menu_new, CONF_TOP10_MENU) < 0)
487                            {
488                                    unload_menu(&top10_menu_new);
489                                    log_error("Reload top10 menu failed\n");
490                            }
491                            else
492                            {
493                                    unload_menu(&top10_menu);
494                                    top10_menu_new.allow_exit = 1;
495                                    memcpy(&top10_menu, &top10_menu_new, sizeof(top10_menu_new));
496                                    log_common("Reload top10 menu successfully\n");
497                          }                          }
498    
499                          for (int i = 0; i < data_files_load_startup_count; i++)                          for (int i = 0; i < data_files_load_startup_count; i++)


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

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