Fixes: #9201
Backport: firefly
We sometimes need to call RGWPutObjProcessor::handle_data() again,
so that we send the pending data. However, we failed to clear the buffer
that was already sent, thus it was resent. This triggers when using non
default pool alignments.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit
9181114d6f6062c55ee4b351fc3495345e545c36)
bool exclusive = (!write_ofs && immutable_head()); /* immutable head object, need to verify nothing exists there
we could be racing with another upload, to the same
object and cleanup can be messy */
- return write_data(bl, write_ofs, phandle, exclusive);
+ int ret = write_data(bl, write_ofs, phandle, exclusive);
+ if (ret >= 0) { /* we might return, need to clear bl as it was already sent */
+ bl.clear();
+ }
+ return ret;
}