olog_manifold->add_sink(ops_log_file);
}
olog_manifold->add_sink(new OpsLogRados(env.driver));
- olog = olog_manifold;
+ env.olog.reset(olog_manifold);
} /* init_opslog */
int rgw::AppMain::init_frontends2(RGWLib* rgwlib)
// initialize RGWProcessEnv
env.rest = &rest;
- env.olog = olog;
env.auth_registry = rgw::auth::StrategyRegistry::create(
dpp->get_cct(), *implicit_tenant_context, env.driver);
env.ratelimiting = ratelimiter.get();
ldh.reset(nullptr); // deletes ldap helper if it was created
rgw_log_usage_finalize();
- delete olog;
-
if (lua_background) {
lua_background->shutdown();
}
<< e.what() << dendl;
}
if (should_log) {
- rgw_log_op(nullptr /* !rest */, s, op, env.olog);
+ rgw_log_op(nullptr /* !rest */, s, op, env.olog.get());
}
int http_ret = s->err.http_ret;
std::vector<RGWFrontendConfig*> fe_configs;
std::multimap<string, RGWFrontendConfig*> fe_map;
std::unique_ptr<rgw::LDAPHelper> ldh;
- OpsLogSink* olog = nullptr;
RGWREST rest;
std::unique_ptr<rgw::lua::Background> lua_background;
std::unique_ptr<rgw::auth::ImplicitTenants> implicit_tenant_context;
} else if (rc < 0) {
ldpp_dout(op, 5) << "WARNING: failed to read pre request script. error: " << rc << dendl;
} else {
- rc = rgw::lua::request::execute(driver, rest, penv.olog, s, op, script);
+ rc = rgw::lua::request::execute(driver, rest, penv.olog.get(), s, op, script);
if (rc < 0) {
ldpp_dout(op, 5) << "WARNING: failed to execute pre request script. error: " << rc << dendl;
}
} else if (rc < 0) {
ldpp_dout(op, 5) << "WARNING: failed to read post request script. error: " << rc << dendl;
} else {
- rc = rgw::lua::request::execute(driver, rest, penv.olog, s, op, script);
+ rc = rgw::lua::request::execute(driver, rest, penv.olog.get(), s, op, script);
if (rc < 0) {
ldpp_dout(op, 5) << "WARNING: failed to execute post request script. error: " << rc << dendl;
}
perfcounter->inc(l_rgw_qactive, -1);
}
if (should_log) {
- rgw_log_op(rest, s, op, penv.olog);
+ rgw_log_op(rest, s, op, penv.olog.get());
}
if (http_ret != nullptr) {
rgw::sal::Driver* driver = nullptr;
rgw::SiteConfig* site = nullptr;
RGWREST *rest = nullptr;
- OpsLogSink *olog = nullptr;
+ std::unique_ptr<OpsLogSink> olog;
std::unique_ptr<rgw::auth::StrategyRegistry> auth_registry;
ActiveRateLimiter* ratelimiting = nullptr;