1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #6320 from LK4D4/fix_stdcopy_eof

Don't exit on eof in header reading in stdcopy
This commit is contained in:
Michael Crosby 2014-06-17 14:20:13 -07:00
commit 4dcf4e9bd0

View file

@ -82,13 +82,14 @@ func StdCopy(dstout, dsterr io.Writer, src io.Reader) (written int64, err error)
for nr < StdWriterPrefixLen {
var nr2 int
nr2, er = src.Read(buf[nr:])
if er == io.EOF {
return written, nil
}
if er != nil {
// Don't exit on EOF, because we can have some more input
if er != nil && er != io.EOF {
return 0, er
}
nr += nr2
if nr == 0 {
return written, nil
}
}
// Check the first byte to know where to write