Close VPN fabric session stream shards

This commit is contained in:
2026-05-16 12:26:51 +03:00
parent a5b91113bf
commit d170820445
4 changed files with 105 additions and 0 deletions
@@ -69,6 +69,10 @@ type packetTransportSnapshotter interface {
Snapshot() map[string]any
}
type packetTransportCloser interface {
Close() error
}
type BackendPacketTransport struct {
API *client.Client
ClusterID string
@@ -259,6 +263,9 @@ func (g *Gateway) normalize() error {
func (g *Gateway) run(ctx context.Context, tun readWriteCloser) error {
defer tun.Close()
if closer, ok := g.Transport.(packetTransportCloser); ok {
defer closer.Close()
}
errCh := make(chan error, 2)
go func() { errCh <- g.copyGatewayToClient(ctx, tun) }()