/* Create an instance of stream-abstracting class. Having this indirection
* allows for easy introduction of decompressors like gzip and bzip2. */
auto stream = create_stream();
+ if (! stream) {
+ return;
+ }
+
auto status = rgw::tar::StatusIndicator::create();
do {
op_ret = stream->get_exactly(rgw::tar::BLOCK_SIZE, buffer);
req_state* const s;
public:
- SwiftStreamGetter(req_state* const s)
- : conlen(atoll(s->length)),
+ SwiftStreamGetter(req_state* const s, const size_t conlen)
+ : conlen(conlen),
curpos(0),
s(s) {
}
}
};
- // FIXME: lack of conlen
- ldout(s->cct, 20) << "bulk upload: create_stream for length="
- << s->length << dendl;
- return std::unique_ptr<SwiftStreamGetter>(new SwiftStreamGetter(s));
+ if (! s->length) {
+ op_ret = -EINVAL;
+ return nullptr;
+ } else {
+ ldout(s->cct, 20) << "bulk upload: create_stream for length="
+ << s->length << dendl;
+
+ const size_t conlen = atoll(s->length);
+ return std::unique_ptr<SwiftStreamGetter>(new SwiftStreamGetter(s, conlen));
+ }
}
void RGWBulkUploadOp_ObjStore_SWIFT::send_response()