Skip to content

Commit 47cbf7f

Browse files
committed
Close inbound conn
1 parent f7e6510 commit 47cbf7f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

common/singbridge/packet.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
func CopyPacketConn(ctx context.Context, inboundConn net.Conn, link *transport.Link, destination net.Destination, serverConn net.PacketConn) error {
1818
cancel := func() {
1919
common.Interrupt(link.Reader)
20+
common.Interrupt(serverConn)
2021
}
2122
conn := &PacketConnWrapper{
2223
Reader: link.Reader,

common/singbridge/pipe.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ func CopyConn(ctx context.Context, inboundConn net.Conn, link *transport.Link, s
2424
conn.R = &buf.BufferedReader{Reader: link.Reader}
2525
}
2626
cancel := func() {
27-
common.Interrupt(conn.R)
27+
common.Interrupt(link.Reader)
28+
common.Interrupt(serverConn)
2829
}
2930
conn.T = signal.CancelAfterInactivity(ctx, cancel, 300*time.Second)
3031
return ReturnError(bufio.CopyConn(ctx, conn, serverConn))

0 commit comments

Comments
 (0)