fixed a nil check issue

This commit is contained in:
2025-10-08 14:29:32 +09:00
parent 437ab8ccef
commit f9e3030268
3 changed files with 6 additions and 5 deletions

View File

@ -2721,7 +2721,7 @@ func (c *Client) run_single_ctl_server(i int, cs *http.Server, wg *sync.WaitGrou
} else { } else {
err = fmt.Errorf("stop requested") err = fmt.Errorf("stop requested")
} }
if errors.Is(err, http.ErrServerClosed) { if err == nil || errors.Is(err, http.ErrServerClosed) {
c.log.Write("", LOG_INFO, "Control channel[%d] ended", i) c.log.Write("", LOG_INFO, "Control channel[%d] ended", i)
} else { } else {
c.log.Write("", LOG_ERROR, "Control channel[%d] error - %s", i, err.Error()) c.log.Write("", LOG_ERROR, "Control channel[%d] error - %s", i, err.Error())

View File

@ -63,6 +63,7 @@ chan_loop:
//signal.Reset(syscall.SIGTERM) //signal.Reset(syscall.SIGTERM)
signal.Stop(sighup_chan) signal.Stop(sighup_chan)
signal.Stop(sigterm_chan) signal.Stop(sigterm_chan)
signal.Ignore(syscall.SIGHUP, syscall.SIGTERM, os.Interrupt)
} }
func (sh *signal_handler) StartService(data interface{}) { func (sh *signal_handler) StartService(data interface{}) {

View File

@ -2092,7 +2092,7 @@ func (s* Server) run_single_ctl_server(i int, cs *http.Server, wg* sync.WaitGrou
} else { } else {
err = fmt.Errorf("stop requested") err = fmt.Errorf("stop requested")
} }
if errors.Is(err, http.ErrServerClosed) { if err == nil || errors.Is(err, http.ErrServerClosed) {
s.log.Write("", LOG_INFO, "Control channel[%d] ended", i) s.log.Write("", LOG_INFO, "Control channel[%d] ended", i)
} else { } else {
s.log.Write("", LOG_ERROR, "Control channel[%d] error - %s", i, err.Error()) s.log.Write("", LOG_ERROR, "Control channel[%d] error - %s", i, err.Error())
@ -2148,7 +2148,7 @@ func (s *Server) run_single_rpx_server(i int, cs *http.Server, wg* sync.WaitGrou
} else { } else {
err = fmt.Errorf("stop requested") err = fmt.Errorf("stop requested")
} }
if errors.Is(err, http.ErrServerClosed) { if err == nil || errors.Is(err, http.ErrServerClosed) {
s.log.Write("", LOG_INFO, "RPX channel[%d] ended", i) s.log.Write("", LOG_INFO, "RPX channel[%d] ended", i)
} else { } else {
s.log.Write("", LOG_ERROR, "RPX channel[%d] error - %s", i, err.Error()) s.log.Write("", LOG_ERROR, "RPX channel[%d] error - %s", i, err.Error())
@ -2205,7 +2205,7 @@ func (s *Server) run_single_pxy_server(i int, cs *http.Server, wg* sync.WaitGrou
} else { } else {
err = fmt.Errorf("stop requested") err = fmt.Errorf("stop requested")
} }
if errors.Is(err, http.ErrServerClosed) { if err == nil || errors.Is(err, http.ErrServerClosed) {
s.log.Write("", LOG_INFO, "Proxy channel[%d] ended", i) s.log.Write("", LOG_INFO, "Proxy channel[%d] ended", i)
} else { } else {
s.log.Write("", LOG_ERROR, "Proxy channel[%d] error - %s", i, err.Error()) s.log.Write("", LOG_ERROR, "Proxy channel[%d] error - %s", i, err.Error())
@ -2261,7 +2261,7 @@ func (s *Server) run_single_wpx_server(i int, cs *http.Server, wg* sync.WaitGrou
} else { } else {
err = fmt.Errorf("stop requested") err = fmt.Errorf("stop requested")
} }
if errors.Is(err, http.ErrServerClosed) { if err == nil || errors.Is(err, http.ErrServerClosed) {
s.log.Write("", LOG_INFO, "Wpx channel[%d] ended", i) s.log.Write("", LOG_INFO, "Wpx channel[%d] ended", i)
} else { } else {
s.log.Write("", LOG_ERROR, "Wpx channel[%d] error - %s", i, err.Error()) s.log.Write("", LOG_ERROR, "Wpx channel[%d] error - %s", i, err.Error())