mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-02 09:48:43 +00:00
TUN inbound: Cancel ctx when handling is done (#5565)
https://github.com/XTLS/Xray-core/pull/5565#issuecomment-3777939907 --------- Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
@@ -106,8 +106,9 @@ func (t *Handler) HandleConnection(conn net.Conn, destination net.Destination) {
|
|||||||
// to close, send completion packets back to the network, and cleanup
|
// to close, send completion packets back to the network, and cleanup
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
sid := session.NewID()
|
ctx, cancel := context.WithCancel(t.ctx)
|
||||||
ctx := c.ContextWithID(t.ctx, sid)
|
defer cancel()
|
||||||
|
ctx = c.ContextWithID(ctx, session.NewID())
|
||||||
|
|
||||||
source := net.DestinationFromAddr(conn.RemoteAddr())
|
source := net.DestinationFromAddr(conn.RemoteAddr())
|
||||||
inbound := session.Inbound{
|
inbound := session.Inbound{
|
||||||
|
|||||||
Reference in New Issue
Block a user