Skip to content

Commit 463915c

Browse files
OwersunRPRX
authored andcommitted
TUN inbound: Close connection when handling is done (XTLS#5531)
XTLS#5531 (comment)
1 parent 0c4c1ac commit 463915c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

proxy/tun/handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ func (t *Handler) Init(ctx context.Context, pm policy.Manager, dispatcher routin
102102

103103
// HandleConnection pass the connection coming from the ip stack to the routing dispatcher
104104
func (t *Handler) HandleConnection(conn net.Conn, destination net.Destination) {
105+
// when handling is done with any outcome, always signal back to the incoming connection
106+
// to close, send completion packets back to the network, and cleanup
107+
defer conn.Close()
108+
105109
sid := session.NewID()
106110
ctx := c.ContextWithID(t.ctx, sid)
107111

0 commit comments

Comments
 (0)