From bcb5d3b7ef587588b8947a30dc15ac8c107eede7 Mon Sep 17 00:00:00 2001 From: "jerard@alfa-safety.fr" Date: Tue, 30 Jun 2020 18:28:47 +0200 Subject: [PATCH] fixup! Fix early closure of data stream. --- pkg/bastion/session.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/bastion/session.go b/pkg/bastion/session.go index 14c75c8..31a2e39 100644 --- a/pkg/bastion/session.go +++ b/pkg/bastion/session.go @@ -201,7 +201,7 @@ func pipe(lreqs, rreqs <-chan *gossh.Request, lch, rch gossh.Channel, logsLocati quit <- "rreqs" }(quit) - lchEof, rchEof, lchClosed, rchClosed := false, false, false, false + lchEOF, rchEOF, lchClosed, rchClosed := false, false, false, false for { select { case err := <-errch: @@ -209,10 +209,10 @@ func pipe(lreqs, rreqs <-chan *gossh.Request, lch, rch gossh.Channel, logsLocati case q := <-quit: switch q { case "lch": - lchEof = true + lchEOF = true _ = rch.CloseWrite() case "rch": - rchEof = true + rchEOF = true _ = lch.CloseWrite() case "lreqs": lchClosed = true @@ -220,15 +220,15 @@ func pipe(lreqs, rreqs <-chan *gossh.Request, lch, rch gossh.Channel, logsLocati rchClosed = true } - if lchEof && lchClosed && !rchClosed { + if lchEOF && lchClosed && !rchClosed { rch.Close() } - if rchEof && rchClosed && !lchClosed { + if rchEOF && rchClosed && !lchClosed { lch.Close() } - if lchEof && rchEof && lchClosed && rchClosed { + if lchEOF && rchEOF && lchClosed && rchClosed { return nil } }