It would be nice to have some compile-type assistance w/the
dual RGWOp & RGWLibRequest boilerplate.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
req->log_format(s, "initializing for trans_id = %s", s->trans_id.c_str());
- RGWOp *op = dynamic_cast<RGWOp*>(req);
- req->op = op; // XXX but we can do this in the ctor!
+ /* XXX the following works, but we shouldn't need to pay for a
+ * dynamic cast */
+ RGWOp *op = reinterpret_cast<RGWOp*>(req); // req->op is already correct
bool should_log = true;
RGWListBucketsRequest(uint64_t _req_id,
rgw_readdir_cb _rcb, void* _cb_arg, uint64_t _offset)
: RGWLibRequest(_req_id), offset(_offset), cb_arg(_cb_arg), rcb(_rcb) {
- // nothing
+ // req->op = op
+ op = this;
}
int operator()(const std::string& name, const std::string& marker) {