Squashed commit of the following:
commit
d3cdafa9cdead598b4719b49d7c0cb5c7c122143
Author: Kanimozhi Murthi <kamurthi@cisco.com>
Date: Sun May 31 22:15:50 2020 -0400
appid: Match http2 response to request
AppIdHttpSession* hsession;
if (http_event->get_is_http2())
{
- if (asd->get_prev_http2_raw_packet() != asd->session_packet_count)
+ if (direction == APP_ID_FROM_INITIATOR)
{
- asd->delete_all_http_sessions();
- asd->set_prev_http2_raw_packet(asd->session_packet_count);
+ if (asd->get_prev_http2_raw_packet() != asd->session_packet_count)
+ {
+ asd->delete_all_http_sessions();
+ asd->set_prev_http2_raw_packet(asd->session_packet_count);
+ }
+ hsession = asd->create_http_session(http_event->get_http2_stream_id());
+ }
+ else
+ {
+ hsession = asd->get_matching_http_session(http_event->get_http2_stream_id());
+ if (!hsession)
+ hsession = asd->create_http_session(http_event->get_http2_stream_id());
}
-
- hsession = asd->create_http_session(http_event->get_http2_stream_id());
}
else
{
return nullptr;
}
+AppIdHttpSession* AppIdSession::get_matching_http_session(uint32_t stream_id)
+{
+ for (uint32_t stream_index=0; stream_index < hsessions.size(); stream_index++)
+ {
+ if(stream_id == hsessions[stream_index]->get_http2_stream_id())
+ return hsessions[stream_index];
+ }
+ return nullptr;
+}
+
AppIdDnsSession* AppIdSession::create_dns_session()
{
if (dsession)
AppIdHttpSession* create_http_session(uint32_t stream_id = 0);
AppIdHttpSession* get_http_session(uint32_t stream_index = 0);
+ AppIdHttpSession* get_matching_http_session(uint32_t stream_id);
void delete_all_http_sessions()
{
for (auto hsession : hsessions)
return nullptr;
}
+AppIdHttpSession* AppIdSession::get_matching_http_session(uint32_t stream_id)
+{
+ for (uint32_t stream_index=0; stream_index < hsessions.size(); stream_index++)
+ {
+ if(stream_id == hsessions[stream_index]->get_http2_stream_id())
+ return hsessions[stream_index];
+ }
+ return nullptr;
+}
+
AppIdDnsSession* AppIdSession::create_dns_session()
{
if ( !dsession )