Squashed commit of the following:
commit
472fe39ed1ec39a11bbc0748b4f1368b8a7d6a1e
Author: Oleksii Zaika <ozaika@cisco.com>
Date: Mon Mar 23 06:13:16 2020 -0400
appid: use http2 inspector for detection even if third-party module is present
HttpEvent* http_event = (HttpEvent*)&event;
AppidChangeBits change_bits;
+ if (asd->ctxt.get_tp_appid_ctxt() && !http_event->get_is_http2())
+ return;
+
if (appidDebug->is_active())
LogMessage("AppIdDbg %s Processing HTTP metadata from HTTP Inspector\n",
appidDebug->get_debug_session());
ctxt->init_appid(sc);
- if (!ctxt->get_tp_appid_ctxt())
- {
- DataBus::subscribe_global(HTTP_REQUEST_HEADER_EVENT_KEY, new HttpEventHandler(
- HttpEventHandler::REQUEST_EVENT), sc);
+ DataBus::subscribe_global(HTTP_REQUEST_HEADER_EVENT_KEY, new HttpEventHandler(
+ HttpEventHandler::REQUEST_EVENT), sc);
+
+ DataBus::subscribe_global(HTTP_RESPONSE_HEADER_EVENT_KEY, new HttpEventHandler(
+ HttpEventHandler::RESPONSE_EVENT), sc);
- DataBus::subscribe_global(HTTP_RESPONSE_HEADER_EVENT_KEY, new HttpEventHandler(
- HttpEventHandler::RESPONSE_EVENT), sc);
- }
DataBus::subscribe_global(DATA_DECRYPT_EVENT, new DataDecryptEventHandler(), sc);
return true;
#include <CppUTestExt/MockSupport.h>
THREAD_LOCAL AppIdDebug* appidDebug = nullptr;
+ThirdPartyAppIdContext* AppIdContext::tp_appid_ctxt = nullptr;
void AppIdDebug::activate(const Flow*, const AppIdSession*, bool) { active = true; }
void ApplicationDescriptor::set_id(const Packet&, AppIdSession&, AppidSessionDirection, AppId, AppidChangeBits&) { }
// some cases. Treat it like HTTP w/ is_http2 flag set.
if ((tp_app_id == APP_ID_HTTP2) && (tp_confidence == 100))
{
- if (appidDebug->is_active())
- LogMessage("AppIdDbg %s 3rd party saw HTTP/2\n",
- appidDebug->get_debug_session());
-
- tp_app_id = APP_ID_HTTP;
asd.is_http2 = true;
}
// if the third-party appId must be treated as a client, do it now