mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 15:34:01 +03:00
Always close connection on context finished
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user