Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fatedier committed Apr 8, 2019
1 parent 79237d2 commit 7f9d88c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions client/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ func (ctl *Control) HandleNewProxyResp(inMsg *msg.NewProxyResp) {
func (ctl *Control) Close() error {
ctl.pm.Close()
ctl.conn.Close()
if ctl.session != nil {
ctl.session.Close()
}
return nil
}

Expand Down Expand Up @@ -202,6 +205,7 @@ func (ctl *Control) reader() {
return
} else {
ctl.Warn("read error: %v", err)
ctl.conn.Close()
return
}
} else {
Expand Down Expand Up @@ -300,6 +304,9 @@ func (ctl *Control) worker() {
ctl.vm.Close()

close(ctl.closedDoneCh)
if ctl.session != nil {
ctl.session.Close()
}
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/frpc/sub/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var (
)

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")

kcpDoneCh = make(chan struct{})
Expand Down
2 changes: 1 addition & 1 deletion cmd/frps/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var (
)

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().StringVarP(&bindAddr, "bind_addr", "", "0.0.0.0", "bind address")
Expand Down
1 change: 1 addition & 0 deletions server/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ func (ctl *Control) reader() {
return
} else {
ctl.conn.Warn("read error: %v", err)
ctl.conn.Close()
return
}
} else {
Expand Down

0 comments on commit 7f9d88c

Please sign in to comment.