}
int RGWGetObj_BlockDecrypt::fixup_range(off_t& bl_ofs, off_t& bl_end) {
+ /*
+ * Cascade to the next filter first so it sees the original
+ * plaintext range before we block-align for decryption.
+ */
+ if (next)
+ next->fixup_range(bl_ofs, bl_end);
+
off_t inp_ofs = bl_ofs;
off_t inp_end = bl_end;
if (parts_len.size() > 0) {
ldpp_dout(this->dpp, 20) << "fixup_range [" << inp_ofs << "," << inp_end
<< "] => [" << bl_ofs << "," << bl_end << "]" << dendl;
- if (next)
- return next->fixup_range(bl_ofs, bl_end);
-
return 0;
}
goto done_err;
total_len = (ofs <= end ? end + 1 - ofs : 0);
- ofs_x = ofs;
- end_x = end;
- filter->fixup_range(ofs_x, end_x);
-
/* Check whether the object has expired. Swift API documentation
* stands that we should return 404 Not Found in such case. */
if (need_object_expiration() && s->object->is_expired()) {
attr_iter != attrs.end() ? &(attr_iter->second) : nullptr);
if (decrypt != nullptr) {
filter = decrypt.get();
- filter->fixup_range(ofs_x, end_x);
}
if (op_ret < 0) {
goto done_err;
}
+ ofs_x = ofs;
+ end_x = end;
+ filter->fixup_range(ofs_x, end_x);
+
if (!get_data || ofs > end) {
send_response_data(bl, 0, 0);