diff --git a/pkg/httputils/MAINTAINERS b/pkg/httputils/MAINTAINERS new file mode 100644 index 0000000000..6dde4769d7 --- /dev/null +++ b/pkg/httputils/MAINTAINERS @@ -0,0 +1 @@ +Cristian Staretu (@unclejack) diff --git a/utils/resumablerequestreader.go b/pkg/httputils/resumablerequestreader.go similarity index 96% rename from utils/resumablerequestreader.go rename to pkg/httputils/resumablerequestreader.go index bed202ec0c..dbc9d9b292 100644 --- a/utils/resumablerequestreader.go +++ b/pkg/httputils/resumablerequestreader.go @@ -1,8 +1,9 @@ -package utils +package httputils import ( "fmt" "io" + "log" "net/http" "time" ) @@ -70,7 +71,7 @@ func (r *resumableRequestReader) Read(p []byte) (n int, err error) { r.cleanUpResponse() } if err != nil && err != io.EOF { - Debugf("encountered error during pull and clearing it before resume: %s", err) + log.Printf("encountered error during pull and clearing it before resume: %s", err) err = nil } return n, err diff --git a/registry/registry.go b/registry/registry.go index 567cd9f70f..9563c3b286 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -24,6 +24,7 @@ import ( "time" "github.com/docker/docker/dockerversion" + "github.com/docker/docker/pkg/httputils" "github.com/docker/docker/utils" ) @@ -423,7 +424,7 @@ func (r *Registry) GetRemoteImageLayer(imgID, registry string, token []string, i if res.Header.Get("Accept-Ranges") == "bytes" && imgSize > 0 { utils.Debugf("server supports resume") - return utils.ResumableRequestReaderWithInitialResponse(client, req, 5, imgSize, res), nil + return httputils.ResumableRequestReaderWithInitialResponse(client, req, 5, imgSize, res), nil } utils.Debugf("server doesn't support resume") return res.Body, nil