@@ -102,90 +102,12 @@ namespace modsecurity {
102102 * @endcode 
103103 * 
104104 */  
105- Transaction::Transaction (ModSecurity *ms, RulesSet *rules, void  *logCbData)
106-     : m_creationTimeStamp(utils::cpu_seconds()),
107-     m_clientIpAddress (" " 
108-     m_httpVersion(" " 
109-     m_serverIpAddress(" " 
110-     m_requestHostName(" " 
111-     m_uri(" " 
112-     m_uri_no_query_string_decoded(" " 
113-     m_ARGScombinedSizeDouble(0 ),
114-     m_clientPort(0 ),
115-     m_highestSeverityAction(255 ),
116-     m_httpCodeReturned(200 ),
117-     m_serverPort(0 ),
118-     m_ms(ms),
119-     m_requestBodyType(UnknownFormat),
120-     m_requestBodyProcessor(UnknownFormat),
121-     m_rules(rules),
122-     m_ruleRemoveById(),
123-     m_ruleRemoveByIdRange(),
124-     m_ruleRemoveByTag(),
125-     m_ruleRemoveTargetByTag(),
126-     m_ruleRemoveTargetById(),
127-     m_requestBodyAccess(RulesSet::PropertyNotSetConfigBoolean),
128-     m_auditLogModifier(),
129-     m_ctlAuditEngine(AuditLog::AuditLogStatus::NotSetLogStatus),
130-     m_rulesMessages(),
131-     m_requestBody(),
132-     m_responseBody(),
133-     /*  m_id(), */ 
134-     m_skip_next(0 ),
135-     m_allowType(modsecurity::actions::disruptive::NoneAllowType),
136-     m_uri_decoded(" " 
137-     m_actions(),
138-     m_it(),
139-     m_timeStamp(std::time(NULL )),
140-     m_collections(ms->m_global_collection, ms->m_ip_collection,
141-         ms->m_session_collection, ms->m_user_collection,
142-         ms->m_resource_collection),
143-     m_matched(),
144- #ifdef  WITH_LIBXML2
145-     m_xml (new  RequestBodyProcessor::XML(this )),
146- #else 
147-     m_xml (NULL ),
148- #endif 
149- #ifdef  WITH_YAJL
150-     m_json (new  RequestBodyProcessor::JSON(this )),
151- #else 
152-     m_json (NULL ),
153- #endif 
154-     m_secRuleEngine (RulesSetProperties::PropertyNotSetRuleEngine),
155-     m_variableDuration(" " 
156-     m_variableEnvs(),
157-     m_variableHighestSeverityAction(" " 
158-     m_variableRemoteUser(" " 
159-     m_variableTime(" " 
160-     m_variableTimeDay(" " 
161-     m_variableTimeEpoch(" " 
162-     m_variableTimeHour(" " 
163-     m_variableTimeMin(" " 
164-     m_variableTimeSec(" " 
165-     m_variableTimeWDay(" " 
166-     m_variableTimeYear(" " 
167-     m_logCbData(logCbData),
168-     TransactionAnchoredVariables(this ) {
169-     m_id = std::to_string (m_timeStamp) +
170-            std::to_string (modsecurity::utils::generate_transaction_unique_id ());
171- 
172-     m_variableUrlEncodedError.set (" 0" 0 );
173-     m_variableMscPcreError.set (" 0" 0 );
174-     m_variableMscPcreLimitsExceeded.set (" 0" 0 );
175- 
176-     ms_dbg (4 , " Initializing transaction" 
177105
178-      intervention::clean (&m_it); 
179- }
106+ Transaction::Transaction (ModSecurity *ms, RulesSet *rules,  void  *logCbData) 
107+     : Transaction(ms, rules,  nullptr , logCbData) {  }
180108
181109Transaction::Transaction (ModSecurity *ms, RulesSet *rules, char  *id, void  *logCbData)
182110    : m_creationTimeStamp(utils::cpu_seconds()),
183-     m_clientIpAddress(" " 
184-     m_httpVersion(" " 
185-     m_serverIpAddress(" " 
186-     m_requestHostName(" " 
187-     m_uri(" " 
188-     m_uri_no_query_string_decoded(" " 
189111    m_ARGScombinedSizeDouble (0 ),
190112    m_clientPort(0 ),
191113    m_highestSeverityAction(255 ),
@@ -195,53 +117,33 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, char *id, void *logCb
195117    m_requestBodyType(UnknownFormat),
196118    m_requestBodyProcessor(UnknownFormat),
197119    m_rules(rules),
198-     m_ruleRemoveById(),
199-     m_ruleRemoveByIdRange(),
200-     m_ruleRemoveByTag(),
201-     m_ruleRemoveTargetByTag(),
202-     m_ruleRemoveTargetById(),
203120    m_requestBodyAccess(RulesSet::PropertyNotSetConfigBoolean),
204-     m_auditLogModifier(),
205121    m_ctlAuditEngine(AuditLog::AuditLogStatus::NotSetLogStatus),
206-     m_rulesMessages(),
207-     m_requestBody(),
208-     m_responseBody(),
209-     m_id(id),
210122    m_skip_next(0 ),
211123    m_allowType(modsecurity::actions::disruptive::NoneAllowType),
212-     m_uri_decoded(" " 
213-     m_actions(),
214-     m_it(),
215-     m_timeStamp(std::time(NULL )),
124+     m_timeStamp(std::time(nullptr )),
216125    m_collections(ms->m_global_collection, ms->m_ip_collection,
217126        ms->m_session_collection, ms->m_user_collection,
218127        ms->m_resource_collection),
219-     m_matched(),
220128#ifdef  WITH_LIBXML2
221129    m_xml (new  RequestBodyProcessor::XML(this )),
222130#else 
223-     m_xml (NULL ),
131+     m_xml (nullptr ),
224132#endif 
225133#ifdef  WITH_YAJL
226134    m_json (new  RequestBodyProcessor::JSON(this )),
227135#else 
228-     m_json (NULL ),
136+     m_json (nullptr ),
229137#endif 
230138    m_secRuleEngine (RulesSetProperties::PropertyNotSetRuleEngine),
231-     m_variableDuration(" " 
232-     m_variableEnvs(),
233-     m_variableHighestSeverityAction(" " 
234-     m_variableRemoteUser(" " 
235-     m_variableTime(" " 
236-     m_variableTimeDay(" " 
237-     m_variableTimeEpoch(" " 
238-     m_variableTimeHour(" " 
239-     m_variableTimeMin(" " 
240-     m_variableTimeSec(" " 
241-     m_variableTimeWDay(" " 
242-     m_variableTimeYear(" " 
243139    m_logCbData(logCbData),
244140    TransactionAnchoredVariables(this ) {
141+     if  (id == nullptr ) {
142+         m_id = std::to_string (m_timeStamp) +
143+             std::to_string (modsecurity::utils::generate_transaction_unique_id ());
144+     } else  {
145+         m_id = id;
146+     }
245147
246148    m_variableUrlEncodedError.set (" 0" 0 );
247149    m_variableMscPcreError.set (" 0" 0 );
0 commit comments