Skip to content

Commit

Permalink
Merge pull request #7452 from mook-as/networking/re-merge-pr-29
Browse files Browse the repository at this point in the history
Merge rancher-desktop-networking v1.2.7
  • Loading branch information
jandubois committed Sep 10, 2024
2 parents c4fc5da + 9c12073 commit 16e528f
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 16e528f

Please sign in to comment.