File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ class ModSecurity {
278
278
ModSecurity ();
279
279
~ModSecurity ();
280
280
281
- static const std::string whoAmI ();
281
+ const std::string& whoAmI ();
282
282
void setConnectorInformation (std::string connector);
283
283
void setServerLogCb (ModSecLogCb cb);
284
284
/* *
@@ -304,6 +304,7 @@ class ModSecurity {
304
304
305
305
private:
306
306
std::string m_connector;
307
+ std::string m_whoami;
307
308
ModSecLogCb m_logCb;
308
309
int m_logProperties;
309
310
};
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ namespace modsecurity {
61
61
*/
62
62
ModSecurity::ModSecurity ()
63
63
: m_connector(" " ),
64
+ m_whoami (" " ),
64
65
#ifdef WITH_LMDB
65
66
m_global_collection (new collection::backend::LMDB()),
66
67
m_resource_collection(new collection::backend::LMDB()),
@@ -116,7 +117,7 @@ ModSecurity::~ModSecurity() {
116
117
* update it, make it in a fashion that won't break the existent parsers.
117
118
* (e.g. adding extra information _only_ to the end of the string)
118
119
*/
119
- const std::string ModSecurity::whoAmI () {
120
+ const std::string& ModSecurity::whoAmI () {
120
121
std::string platform (" Unknown platform" );
121
122
122
123
#if AIX
@@ -139,8 +140,11 @@ const std::string ModSecurity::whoAmI() {
139
140
platform = " Windows" ;
140
141
#endif
141
142
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;
144
148
}
145
149
146
150
You can’t perform that action at this time.
0 commit comments