From f8148c954bf26d2f228b9ec16282d80b062328f8 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 16 Aug 2022 15:21:07 +0400 Subject: [PATCH] [#317] client: Fix processing of the Object PUT failed response In previous implementation `ObjectWrite.Close` called `close` method which in turn called `result` callback. Thus failed statuses could lead to false-positive result processing. Replace calling `close` method with direct `closer` method's call in `ObjectWrite.Close`. Signed-off-by: Leonard Lyubich --- client/object_put.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/object_put.go b/client/object_put.go index 8c0ca1b..24a5539 100644 --- a/client/object_put.go +++ b/client/object_put.go @@ -179,7 +179,7 @@ func (x *ObjectWriter) Close() (*ResObjectPut, error) { return nil, x.ctxCall.err } - if !x.ctxCall.close() { + if x.ctxCall.err = x.ctxCall.closer(); x.ctxCall.err != nil { return nil, x.ctxCall.err }