Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when channel is closed, outbound always by use #447

Open
maxiloEmmmm opened this issue Sep 21, 2023 · 0 comments
Open

when channel is closed, outbound always by use #447

maxiloEmmmm opened this issue Sep 21, 2023 · 0 comments

Comments

@maxiloEmmmm
Copy link

maxiloEmmmm commented Sep 21, 2023

maybe rm outbound when req chan close?
like this

move set outbound nil to func

func (u *udpListener) unsetUDPChan(sshConn ssh.Conn) {

func (u *udpListener) unsetUDPChan(sshConn ssh.Conn) {
	sshConn.Wait()
	u.onLoseChannel()
}

func (u *udpListener) onLoseChannel() {
	u.Debugf("lost channel")
	u.outboundMut.Lock()
	u.outbound = nil
	u.outboundMut.Unlock()
}

call onLoseChannel after chan close

go ssh.DiscardRequests(reqs)

go func() {
  ssh.DiscardRequests(reqs)
  // channel done...
  u.onLoseChannel()
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant