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

fix proxy server memory leak #129

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ShangSky
Copy link

@ShangSky ShangSky commented Apr 8, 2024

// pkg/proxy/proxy.go
err = http.Serve(l, p)
if err != nil && !errors.Is(err, ErrAlreadyAccepted) {
p.logger.Errorw("Serving HTTP request failed.",
	"error", err)
}

<-clientConnNotify.closed // will block
// pkg/proxy/net.go
func (c *ConnNotify) Close() {
	c.Conn.Close()
	c.closed <- struct{}{} // will block
}

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

Successfully merging this pull request may close these issues.

1 participant