File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ class ModSecurity {
278278 ModSecurity ();
279279 ~ModSecurity ();
280280
281- static const std::string whoAmI ();
281+ const std::string& whoAmI ();
282282 void setConnectorInformation (std::string connector);
283283 void setServerLogCb (ModSecLogCb cb);
284284 /* *
@@ -304,6 +304,7 @@ class ModSecurity {
304304
305305 private:
306306 std::string m_connector;
307+ std::string m_whoami;
307308 ModSecLogCb m_logCb;
308309 int m_logProperties;
309310};
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ namespace modsecurity {
6161 */
6262ModSecurity::ModSecurity ()
6363 : m_connector(" " ),
64+ m_whoami (" " ),
6465#ifdef WITH_LMDB
6566 m_global_collection (new collection::backend::LMDB()),
6667 m_resource_collection(new collection::backend::LMDB()),
@@ -116,7 +117,7 @@ ModSecurity::~ModSecurity() {
116117 * update it, make it in a fashion that won't break the existent parsers.
117118 * (e.g. adding extra information _only_ to the end of the string)
118119 */
119- const std::string ModSecurity::whoAmI () {
120+ const std::string& ModSecurity::whoAmI () {
120121 std::string platform (" Unknown platform" );
121122
122123#if AIX
@@ -139,8 +140,11 @@ const std::string ModSecurity::whoAmI() {
139140 platform = " Windows" ;
140141#endif
141142
142- return std::string (" ModSecurity v" MODSECURITY_VERSION \
143- " (" + platform + " )" );
143+ if (m_whoami.empty ()) {
144+ m_whoami = " ModSecurity v" MODSECURITY_VERSION " (" + platform + " )" ;
145+ }
146+
147+ return m_whoami;
144148}
145149
146150
You can’t perform that action at this time.
0 commit comments