mirror of
https://github.com/docker/cli.git
synced 2026-01-16 20:22:36 +03:00
removed useless buffered pipe in import
Upstream-commit: a0880edc6337054725abc9e8338550bc5258f4ab Component: engine
This commit is contained in:
@@ -1213,7 +1213,7 @@ func hijack(method, path string, setRawTerminal bool) error {
|
||||
sendStdin := Go(func() error {
|
||||
_, err := io.Copy(rwc, os.Stdin)
|
||||
if err := rwc.(*net.TCPConn).CloseWrite(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Couldn't send EOF: " + err.Error())
|
||||
fmt.Fprintf(os.Stderr, "Couldn't send EOF: "+err.Error())
|
||||
}
|
||||
return err
|
||||
})
|
||||
|
||||
@@ -338,13 +338,7 @@ func (srv *Server) ImageImport(src, repo, tag string, file *os.File) error {
|
||||
var resp *http.Response
|
||||
|
||||
if src == "-" {
|
||||
r, w := io.Pipe()
|
||||
go func() {
|
||||
defer w.Close()
|
||||
defer Debugf("Closing buffered stdin pipe")
|
||||
io.Copy(w, file)
|
||||
}()
|
||||
archive = r
|
||||
archive = file
|
||||
} else {
|
||||
u, err := url.Parse(src)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user