From 3bf5378a99f1c9ba7aec7339a3701a29543d009e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 13 Feb 2023 22:23:36 +0100 Subject: [PATCH] Differentiate between no retry and immediate retry also in the printed offset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloslav Trmač --- docker/body_reader.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/body_reader.go b/docker/body_reader.go index 4e30743f4..01e926ab0 100644 --- a/docker/body_reader.go +++ b/docker/body_reader.go @@ -34,10 +34,10 @@ type bodyReader struct { firstConnectionTime time.Time body io.ReadCloser // The currently open connection we use to read data, or nil if there is nothing to read from / close. - lastRetryOffset int64 - lastRetryTime time.Time // time.Time{} if N/A - offset int64 // Current offset within the blob - lastSuccessTime time.Time // time.Time{} if N/A + lastRetryOffset int64 // -1 if N/A + lastRetryTime time.Time // time.Time{} if N/A + offset int64 // Current offset within the blob + lastSuccessTime time.Time // time.Time{} if N/A } // newBodyReader creates a bodyReader for request path in c. @@ -56,7 +56,7 @@ func newBodyReader(ctx context.Context, c *dockerClient, path string, firstBody firstConnectionTime: time.Now(), body: firstBody, - lastRetryOffset: 0, + lastRetryOffset: -1, lastRetryTime: time.Time{}, offset: 0, lastSuccessTime: time.Time{},