Squashed commit of the following:
commit
28c121dd6a20db3d8c31d888815b98d0d6cec4a7
Author: Shravan Rangaraju <shrarang@cisco.com>
Date: Thu May 24 18:46:03 2018 -0400
appid: clean only HTTP data on HTTP reinspect
memset(ptype_scan_counts, 0, sizeof(ptype_scan_counts));
}
+void AppIdHttpSession::clear_all_fields()
+{
+ if (host)
+ {
+ delete host;
+ host = nullptr;
+ }
+ if (url)
+ {
+ delete url;
+ url = nullptr;
+ }
+ if (uri)
+ {
+ delete uri;
+ uri = nullptr;
+ }
+ if (referer)
+ {
+ delete referer;
+ referer = nullptr;
+ }
+ if (useragent)
+ {
+ delete useragent;
+ useragent = nullptr;
+ }
+ if (via)
+ {
+ delete via;
+ via = nullptr;
+ }
+ if (cookie)
+ {
+ delete cookie;
+ cookie = nullptr;
+ }
+ if (body)
+ {
+ delete body;
+ body = nullptr;
+ }
+ if (response_code)
+ {
+ delete response_code;
+ response_code = nullptr;
+ }
+ if (content_type)
+ {
+ delete content_type;
+ content_type = nullptr;
+ }
+ if (location)
+ {
+ delete location;
+ location = nullptr;
+ }
+ if (req_body)
+ {
+ delete req_body;
+ req_body = nullptr;
+ }
+ if (server)
+ {
+ delete server;
+ server = nullptr;
+ }
+ if (x_working_with)
+ {
+ delete x_working_with;
+ x_working_with = nullptr;
+ }
+ if (xff_addr)
+ {
+ delete xff_addr;
+ xff_addr = nullptr;
+ }
+ if (xffPrecedence)
+ {
+ for (int i = 0; i < numXffFields; i++)
+ delete xffPrecedence[i];
+ delete xffPrecedence;
+ xffPrecedence = NULL;
+ }
+}
+
virtual void custom_init() { }
+ void clear_all_fields();
+
protected:
void init_chp_match_descriptor(ChpMatchDescriptor& cmd);
int initial_chp_sweep(ChpMatchDescriptor&);
}
}
+void AppIdSession::clear_http_data()
+{
+ if (!hsession) return;
+ hsession->clear_all_fields();
+}
+
AppIdHttpSession* AppIdSession::get_http_session()
{
if ( !hsession )
bool is_payload_appid_set();
void clear_http_flags();
+ void clear_http_data();
void reset_session_data();
AppIdHttpSession* get_http_session();
if (appidDebug->is_active())
LogMessage("AppIdDbg %s 3rd party allow reinspect http\n",
appidDebug->get_debug_session());
- asd.reset_session_data();
+ asd.clear_http_data();
}
if (!asd.is_tp_processing_done())