Always close connection on context finished

This commit is contained in:
9seconds
2021-03-17 21:24:42 +03:00
parent 2408f1530f
commit 80a1de60e6
+5
View File
@@ -29,6 +29,11 @@ func (p *Proxy) ServeConn(conn net.Conn) {
ctx := newStreamContext(p.ctx, p.logger, conn)
defer ctx.Close()
go func() {
<-ctx.Done()
ctx.Close()
}()
p.eventStream.Send(ctx, EventStart{
CreatedAt: time.Now(),
ConnID: ctx.connID,