[#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 <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-08-16 15:21:07 +04:00 committed by LeL
parent 4e31b4f231
commit f8148c954b

View file

@ -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
}