mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 10:14: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)
|
ctx := newStreamContext(p.ctx, p.logger, conn)
|
||||||
defer ctx.Close()
|
defer ctx.Close()
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
<-ctx.Done()
|
||||||
|
ctx.Close()
|
||||||
|
}()
|
||||||
|
|
||||||
p.eventStream.Send(ctx, EventStart{
|
p.eventStream.Send(ctx, EventStart{
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: time.Now(),
|
||||||
ConnID: ctx.connID,
|
ConnID: ctx.connID,
|
||||||
|
|||||||
Reference in New Issue
Block a user