Skip to content

Commit

Permalink
Merge rancher-desktop-networking v1.2.7
Browse files Browse the repository at this point in the history
This picks up a change in rancher-desktop-networking that landed in
Rancher Desktop 1.15.1 that needed to be merged back into the copy of
the code that was merged into the main repo.

Signed-off-by: Mark Yen <mark.yen@suse.com>
  • Loading branch information
mook-as committed Sep 10, 2024
2 parents 0f68745 + 0e89b24 commit 9c12073
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/go/networking/pkg/utils/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,19 @@ func Pipe(conn net.Conn, upstreamAddr string) {
logrus.Errorf("Failed to dial upstream %s: %s", upstreamAddr, err)
return
}
defer upstream.Close()

go func() {
if _, err := io.Copy(upstream, conn); err != nil {
logrus.Debugf("Error copying to upstream: %s", err)
}
if err = upstream.Close(); err != nil {
logrus.Debugf("error closing connection while writing to upstream: %s", err)
}
}()

if _, err := io.Copy(conn, upstream); err != nil {
logrus.Debugf("Error copying from upstream: %s", err)
}
if err = upstream.Close(); err != nil {
logrus.Debugf("error closing connection: %s", err)
}
}

0 comments on commit 9c12073

Please sign in to comment.