Sfoglia il codice sorgente

Fix write after close on http response

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Derek McGowan 10 anni fa
parent
commit
12d83e727d
2 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 1 0
      engine/streams.go
  2. 1 1
      registry/session_v2.go

+ 1 - 0
engine/streams.go

@@ -111,6 +111,7 @@ func (o *Output) Close() error {
 		}
 		}
 	}
 	}
 	o.tasks.Wait()
 	o.tasks.Wait()
+	o.dests = nil
 	return firstErr
 	return firstErr
 }
 }
 
 

+ 1 - 1
registry/session_v2.go

@@ -226,7 +226,7 @@ func (r *Session) PutV2ImageBlob(ep *Endpoint, imageName, sumType, sumStr string
 
 
 	method := "PUT"
 	method := "PUT"
 	log.Debugf("[registry] Calling %q %s", method, location)
 	log.Debugf("[registry] Calling %q %s", method, location)
-	req, err = r.reqFactory.NewRequest(method, location, blobRdr)
+	req, err = r.reqFactory.NewRequest(method, location, ioutil.NopCloser(blobRdr))
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}