mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
frpc: exit with code 1 if first login failed (#3740)
This commit is contained in:
parent
5c4d820eb4
commit
5760c1cf92
@ -1,3 +1,3 @@
|
|||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
* `admin_user` is not effective in the INI configuration.
|
* frpc: Return code 1 when the first login attempt fails and exits.
|
||||||
|
@ -83,8 +83,8 @@ func NewService(
|
|||||||
pxyCfgs []v1.ProxyConfigurer,
|
pxyCfgs []v1.ProxyConfigurer,
|
||||||
visitorCfgs []v1.VisitorConfigurer,
|
visitorCfgs []v1.VisitorConfigurer,
|
||||||
cfgFile string,
|
cfgFile string,
|
||||||
) (svr *Service, err error) {
|
) *Service {
|
||||||
svr = &Service{
|
return &Service{
|
||||||
authSetter: auth.NewAuthSetter(cfg.Auth),
|
authSetter: auth.NewAuthSetter(cfg.Auth),
|
||||||
cfg: cfg,
|
cfg: cfg,
|
||||||
cfgFile: cfgFile,
|
cfgFile: cfgFile,
|
||||||
@ -93,7 +93,6 @@ func NewService(
|
|||||||
ctx: context.Background(),
|
ctx: context.Background(),
|
||||||
exit: 0,
|
exit: 0,
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (svr *Service) GetController() *Control {
|
func (svr *Service) GetController() *Control {
|
||||||
|
@ -139,10 +139,7 @@ func startService(
|
|||||||
log.Info("start frpc service for config file [%s]", cfgFile)
|
log.Info("start frpc service for config file [%s]", cfgFile)
|
||||||
defer log.Info("frpc service for config file [%s] stopped", cfgFile)
|
defer log.Info("frpc service for config file [%s] stopped", cfgFile)
|
||||||
}
|
}
|
||||||
svr, err := client.NewService(cfg, pxyCfgs, visitorCfgs, cfgFile)
|
svr := client.NewService(cfg, pxyCfgs, visitorCfgs, cfgFile)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
shouldGracefulClose := cfg.Transport.Protocol == "kcp" || cfg.Transport.Protocol == "quic"
|
shouldGracefulClose := cfg.Transport.Protocol == "kcp" || cfg.Transport.Protocol == "quic"
|
||||||
// Capture the exit signal if we use kcp or quic.
|
// Capture the exit signal if we use kcp or quic.
|
||||||
@ -150,6 +147,5 @@ func startService(
|
|||||||
go handleTermSignal(svr)
|
go handleTermSignal(svr)
|
||||||
}
|
}
|
||||||
|
|
||||||
_ = svr.Run(context.Background())
|
return svr.Run(context.Background())
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user