Merge pull request #2539 from ceph/wip-9529

Wip 9529

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2014-09-19 11:13:48 -07:00
commit 7f1d9e8ab6
2 changed files with 8 additions and 6 deletions

View File

@ -78,9 +78,11 @@ namespace ceph {
assert(s == SECSuccess);
}
void Update (const byte *input, size_t length) {
SECStatus s;
s = PK11_DigestOp(ctx, input, length);
assert(s == SECSuccess);
if (length) {
SECStatus s;
s = PK11_DigestOp(ctx, input, length);
assert(s == SECSuccess);
}
}
void Final (byte *digest) {
SECStatus s;

View File

@ -1084,11 +1084,11 @@ int RGWPutObjProcessor_Atomic::handle_data(bufferlist& bl, off_t ofs, MD5 *hash,
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 */
if (hash) {
hash->Update((const byte *)bl.c_str(), bl.length());
}
int ret = write_data(bl, write_ofs, phandle, exclusive);
if (ret >= 0) { /* we might return, need to clear bl as it was already sent */
if (hash) {
hash->Update((const byte *)bl.c_str(), bl.length());
}
bl.clear();
}
return ret;