/[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.83 by sysadm, Sun Nov 16 00:19:42 2025 UTC Revision 1.85 by sysadm, Sun Nov 16 04:40:52 2025 UTC
# Line 594  int net_server(const char *hostaddr, in_ Line 594  int net_server(const char *hostaddr, in_
594                                          }                                          }
595                                          else                                          else
596                                          {                                          {
597                                                  sin.sin_addr.s_addr = (uint32_t)j;                                                  ret = hash_dict_inc(hash_dict_sockaddr_count, (uint64_t)j, -1);
                                                 j = 0;  
                                                 ret = hash_dict_get(hash_dict_sockaddr_count, sin.sin_addr.s_addr, (int64_t *)&j);  
                                                 if (ret < 0)  
                                                 {  
                                                         log_error("hash_dict_get(hash_dict_sockaddr_count, %d) error\n", sin.sin_addr.s_addr);  
                                                 }  
                                                 else if (ret == 0)  
                                                 {  
                                                         log_error("hash_dict_get(hash_dict_sockaddr_count, %d) not found\n", sin.sin_addr.s_addr);  
                                                         j = 1;  
                                                 }  
   
                                                 j--;  
                                                 ret = hash_dict_set(hash_dict_sockaddr_count, sin.sin_addr.s_addr, j);  
598                                                  if (ret < 0)                                                  if (ret < 0)
599                                                  {                                                  {
600                                                          log_error("hash_dict_set(hash_dict_sockaddr_count, %d, %d) error\n", sin.sin_addr.s_addr, j);                                                          log_error("hash_dict_inc(hash_dict_sockaddr_count, %d, -1) error\n", j);
601                                                  }                                                  }
602    
603                                                  ret = hash_dict_del(hash_dict_pid_sockaddr, (uint64_t)siginfo.si_pid);                                                  ret = hash_dict_del(hash_dict_pid_sockaddr, (uint64_t)siginfo.si_pid);
# Line 672  int net_server(const char *hostaddr, in_ Line 658  int net_server(const char *hostaddr, in_
658                          SYS_conf_reload = 0;                          SYS_conf_reload = 0;
659                          sd_notify(0, "RELOADING=1");                          sd_notify(0, "RELOADING=1");
660    
661                            // Restart log
662                            if (log_restart() < 0)
663                            {
664                                    log_error("Restart logging failed\n");
665                            }
666    
667                          // Reload configuration                          // Reload configuration
668                          if (load_conf(CONF_BBSD) < 0)                          if (load_conf(CONF_BBSD) < 0)
669                          {                          {
# Line 728  int net_server(const char *hostaddr, in_ Line 720  int net_server(const char *hostaddr, in_
720                                  log_common("Reload section config and gen_ex successfully\n");                                  log_common("Reload section config and gen_ex successfully\n");
721                          }                          }
722    
723                            // Notify child processes to reload configuration
724                            if (kill(-getpid(), SIGUSR1) < 0)
725                            {
726                                    log_error("Send SIGUSR1 signal failed (%d)\n", errno);
727                            }
728    
729                          sd_notify(0, "READY=1");                          sd_notify(0, "READY=1");
730                  }                  }
731    
# Line 806  int net_server(const char *hostaddr, in_ Line 804  int net_server(const char *hostaddr, in_
804                                                                          log_error("hash_dict_set(hash_dict_pid_sockaddr, %d, %s) error\n", pid, hostaddr_client);                                                                          log_error("hash_dict_set(hash_dict_pid_sockaddr, %d, %s) error\n", pid, hostaddr_client);
805                                                                  }                                                                  }
806    
807                                                                  ret = hash_dict_set(hash_dict_sockaddr_count, (uint64_t)sin.sin_addr.s_addr, j + 1);                                                                  ret = hash_dict_inc(hash_dict_sockaddr_count, (uint64_t)sin.sin_addr.s_addr, 1);
808                                                                  if (ret < 0)                                                                  if (ret < 0)
809                                                                  {                                                                  {
810                                                                          log_error("hash_dict_set(hash_dict_sockaddr_count, %s, %d) error\n", hostaddr_client, j + 1);                                                                          log_error("hash_dict_inc(hash_dict_sockaddr_count, %s, %d) error\n", hostaddr_client, 1);
811                                                                  }                                                                  }
812                                                          }                                                          }
813                                                  }                                                  }


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

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