fix flush

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
This commit is contained in:
Victor Vieux 2014-01-22 16:15:23 -08:00
parent 9dcbdbc4b1
commit 90e9a2d85a
2 changed files with 13 additions and 1 deletions

View File

@ -109,6 +109,18 @@ func (o *Output) Write(p []byte) (n int, err error) {
return len(p), firstErr
}
func (o *Output) Flush() {
o.Mutex.Lock()
defer o.Mutex.Unlock()
for _, dst := range o.dests {
if f, ok := dst.(interface {
Flush()
}); ok {
f.Flush()
}
}
}
// Close unregisters all destinations and waits for all background
// AddTail and AddString tasks to complete.
// The Close method of each destination is called if it exists.

View File

@ -1324,7 +1324,7 @@ func (srv *Server) ImagePull(job *engine.Job) engine.Status {
tag string
sf = utils.NewStreamFormatter(job.GetenvBool("json"))
out = utils.NewWriteFlusher(job.Stdout)
authConfig *auth.AuthConfig
authConfig = &auth.AuthConfig{}
metaHeaders map[string][]string
)
if len(job.Args) > 1 {