pull/1190/head
fatedier 6 years ago
parent 79237d2b94
commit 7f9d88c10a

@ -148,6 +148,9 @@ func (ctl *Control) HandleNewProxyResp(inMsg *msg.NewProxyResp) {
func (ctl *Control) Close() error { func (ctl *Control) Close() error {
ctl.pm.Close() ctl.pm.Close()
ctl.conn.Close() ctl.conn.Close()
if ctl.session != nil {
ctl.session.Close()
}
return nil return nil
} }
@ -202,6 +205,7 @@ func (ctl *Control) reader() {
return return
} else { } else {
ctl.Warn("read error: %v", err) ctl.Warn("read error: %v", err)
ctl.conn.Close()
return return
} }
} else { } else {
@ -300,6 +304,9 @@ func (ctl *Control) worker() {
ctl.vm.Close() ctl.vm.Close()
close(ctl.closedDoneCh) close(ctl.closedDoneCh)
if ctl.session != nil {
ctl.session.Close()
}
return return
} }
} }

@ -73,7 +73,7 @@ var (
) )
func init() { func init() {
rootCmd.PersistentFlags().StringVarP(&cfgFile, "", "c", "./frpc.ini", "config file of frpc") rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "./frpc.ini", "config file of frpc")
rootCmd.PersistentFlags().BoolVarP(&showVersion, "version", "v", false, "version of frpc") rootCmd.PersistentFlags().BoolVarP(&showVersion, "version", "v", false, "version of frpc")
kcpDoneCh = make(chan struct{}) kcpDoneCh = make(chan struct{})

@ -62,7 +62,7 @@ var (
) )
func init() { func init() {
rootCmd.PersistentFlags().StringVarP(&cfgFile, "", "c", "", "config file of frps") rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "config file of frps")
rootCmd.PersistentFlags().BoolVarP(&showVersion, "version", "v", false, "version of frpc") rootCmd.PersistentFlags().BoolVarP(&showVersion, "version", "v", false, "version of frpc")
rootCmd.PersistentFlags().StringVarP(&bindAddr, "bind_addr", "", "0.0.0.0", "bind address") rootCmd.PersistentFlags().StringVarP(&bindAddr, "bind_addr", "", "0.0.0.0", "bind address")

@ -301,6 +301,7 @@ func (ctl *Control) reader() {
return return
} else { } else {
ctl.conn.Warn("read error: %v", err) ctl.conn.Warn("read error: %v", err)
ctl.conn.Close()
return return
} }
} else { } else {

Loading…
Cancel
Save