Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
wweir committed Nov 28, 2018
1 parent 1222fdf commit b772ed1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions conf/sower.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ blocklist=[
"img1.blogblog.com",
"*.golang.org", # golang
"go.googlesource.com",
"gist.github.com",
"*.wikipedia.org", # wikipeida
"*.wikimedia.org",
"*.wikisource.org",
Expand Down
3 changes: 3 additions & 0 deletions proxy/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ func openStream(conn net.Conn, sess quic.Session, reDialCh chan<- net.Conn) bool
select {
case okCh <- struct{}{}:
default:
close(okCh)
return
}
close(okCh)

conn.(*net.TCPConn).SetKeepAlive(true)
relay(&streamConn{stream, sess}, conn)
conn.Close()
}()

select {
Expand Down

0 comments on commit b772ed1

Please sign in to comment.