diff --git a/src/agent/Core/ApplicationPool/Context.h b/src/agent/Core/ApplicationPool/Context.h index 0d761ca664..658fa5fc80 100644 --- a/src/agent/Core/ApplicationPool/Context.h +++ b/src/agent/Core/ApplicationPool/Context.h @@ -61,6 +61,8 @@ struct Context { boost::object_pool processObjectPool; mutable boost::mutex agentConfigSyncher; + // Whether to use the old routing algorithm + bool oldRouting; /****** Dependencies ******/ @@ -68,9 +70,10 @@ struct Context { Json::Value agentConfig; - Context() + Context(bool _oldRouting) : sessionObjectPool(64, 1024), - processObjectPool(4, 64) + processObjectPool(4, 64), + oldRouting(_oldRouting) { } void finalize() { diff --git a/src/agent/Core/ApplicationPool/Group.h b/src/agent/Core/ApplicationPool/Group.h index 6755e65701..f7b5ac16ba 100644 --- a/src/agent/Core/ApplicationPool/Group.h +++ b/src/agent/Core/ApplicationPool/Group.h @@ -200,9 +200,6 @@ class Group: public boost::enable_shared_from_this { Callback shutdownCallback; GroupPtr selfPointer; - // Whether to use the old routing algorithm - bool oldRouting; - /****** Initialization and shutdown ******/ static ApiKey generateApiKey(const Pool *pool); diff --git a/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp b/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp index bb90ab2e9d..dd29174f74 100644 --- a/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +++ b/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp @@ -136,7 +136,6 @@ Group::Group(Pool *_pool, const Options &_options) } detachedProcessesCheckerActive = false; - oldRouting = _options.oldRouting; } Group::~Group() { diff --git a/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp b/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp index 943bad744c..56c50b3514 100644 --- a/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp +++ b/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp @@ -359,7 +359,7 @@ Group::get(const Options &newOptions, const GetCallback &callback, bool Group::useNewRouting() const { - return !oldRouting; + return !pool->context->oldRouting; } } // namespace ApplicationPool2 diff --git a/src/agent/Core/ApplicationPool/Options.h b/src/agent/Core/ApplicationPool/Options.h index d6fb11947a..c14333ac00 100644 --- a/src/agent/Core/ApplicationPool/Options.h +++ b/src/agent/Core/ApplicationPool/Options.h @@ -442,8 +442,6 @@ class Options { /*********************************/ - bool oldRouting; - /** * Creates a new Options object with the default values filled in. * One must still set appRoot manually, after having used this constructor. @@ -481,8 +479,7 @@ class Options { statThrottleRate(DEFAULT_STAT_THROTTLE_RATE), maxRequests(0), currentTime(0), - noop(false), - oldRouting(false) + noop(false) /*********************************/ { /*********************************/ diff --git a/src/agent/Core/Controller/InitRequest.cpp b/src/agent/Core/Controller/InitRequest.cpp index 287e8ad37c..002fd0f1c5 100644 --- a/src/agent/Core/Controller/InitRequest.cpp +++ b/src/agent/Core/Controller/InitRequest.cpp @@ -206,7 +206,6 @@ Controller::fillPoolOptionsFromConfigCaches(Options &options, options.statThrottleRate = mainConfig.statThrottleRate; options.maxRequests = requestConfig->defaultMaxRequests; options.stickySessionsCookieAttributes = requestConfig->defaultStickySessionsCookieAttributes; - options.oldRouting = mainConfig.oldRouting; /******************************/ } diff --git a/src/agent/Core/CoreMain.cpp b/src/agent/Core/CoreMain.cpp index 7743b837f3..9594201e74 100644 --- a/src/agent/Core/CoreMain.cpp +++ b/src/agent/Core/CoreMain.cpp @@ -719,7 +719,7 @@ initializeNonPrivilegedWorkingObjects() { wo->spawningKitContext->finalize(); UPDATE_TRACE_POINT(); - wo->appPoolContext = boost::make_shared(); + wo->appPoolContext = boost::make_shared(coreConfig->get("old_routing").asBool()); wo->appPoolContext->spawningKitFactory = boost::make_shared( wo->spawningKitContext.get()); wo->appPoolContext->agentConfig = coreConfig->inspectEffectiveValues();