mirror of
https://github.com/fatedier/frp.git
synced 2024-11-27 12:39:09 +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
|
||||
|
||||
* `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,
|
||||
visitorCfgs []v1.VisitorConfigurer,
|
||||
cfgFile string,
|
||||
) (svr *Service, err error) {
|
||||
svr = &Service{
|
||||
) *Service {
|
||||
return &Service{
|
||||
authSetter: auth.NewAuthSetter(cfg.Auth),
|
||||
cfg: cfg,
|
||||
cfgFile: cfgFile,
|
||||
@ -93,7 +93,6 @@ func NewService(
|
||||
ctx: context.Background(),
|
||||
exit: 0,
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (svr *Service) GetController() *Control {
|
||||
|
@ -139,10 +139,7 @@ func startService(
|
||||
log.Info("start frpc service for config file [%s]", cfgFile)
|
||||
defer log.Info("frpc service for config file [%s] stopped", cfgFile)
|
||||
}
|
||||
svr, err := client.NewService(cfg, pxyCfgs, visitorCfgs, cfgFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
svr := client.NewService(cfg, pxyCfgs, visitorCfgs, cfgFile)
|
||||
|
||||
shouldGracefulClose := cfg.Transport.Protocol == "kcp" || cfg.Transport.Protocol == "quic"
|
||||
// Capture the exit signal if we use kcp or quic.
|
||||
@ -150,6 +147,5 @@ func startService(
|
||||
go handleTermSignal(svr)
|
||||
}
|
||||
|
||||
_ = svr.Run(context.Background())
|
||||
return nil
|
||||
return svr.Run(context.Background())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user