mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
removed useless buffered pipe in import
This commit is contained in:
parent
4d30a32c68
commit
a0880edc63
2 changed files with 2 additions and 8 deletions
|
@ -1213,7 +1213,7 @@ func hijack(method, path string, setRawTerminal bool) error {
|
||||||
sendStdin := Go(func() error {
|
sendStdin := Go(func() error {
|
||||||
_, err := io.Copy(rwc, os.Stdin)
|
_, err := io.Copy(rwc, os.Stdin)
|
||||||
if err := rwc.(*net.TCPConn).CloseWrite(); err != nil {
|
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
|
return err
|
||||||
})
|
})
|
||||||
|
|
|
@ -338,13 +338,7 @@ func (srv *Server) ImageImport(src, repo, tag string, file *os.File) error {
|
||||||
var resp *http.Response
|
var resp *http.Response
|
||||||
|
|
||||||
if src == "-" {
|
if src == "-" {
|
||||||
r, w := io.Pipe()
|
archive = file
|
||||||
go func() {
|
|
||||||
defer w.Close()
|
|
||||||
defer Debugf("Closing buffered stdin pipe")
|
|
||||||
io.Copy(w, file)
|
|
||||||
}()
|
|
||||||
archive = r
|
|
||||||
} else {
|
} else {
|
||||||
u, err := url.Parse(src)
|
u, err := url.Parse(src)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue