aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/http.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-07-06 19:59:56 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-07-06 19:59:56 +0200
commitfd2b524dfb8842a575980d9280862eb6b82e1d7c (patch)
treee521b3380e07a6d71bc6430c95808b2414f15f1a /src/lib/protocols/http.c
parentc408710c5247346e4bd2f9568e848becc592b603 (diff)
Improved RTSP detection the second. (#1232)improved/rtsp_detection_the_second
* RTSP is no subprotocol of HTTP (most of the time) * detection patterns should stay in rtsp.c * set detected HTTP protocol only if at least a valid HTTP method detected Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r--src/lib/protocols/http.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index 36da51078..6a3df8e26 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -499,8 +499,6 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
struct ndpi_packet_struct *packet = &flow->packet;
int ret;
- ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_UNKNOWN);
-
if(flow->http_detected && (flow->http.response_status_code != 0))
return;
@@ -667,7 +665,10 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
}
}
- ndpi_int_http_add_connection(ndpi_struct, flow, packet->detected_protocol_stack[0], NDPI_PROTOCOL_CATEGORY_WEB);
+ if (ndpi_get_http_method(ndpi_struct, flow) != NDPI_HTTP_METHOD_UNKNOWN)
+ {
+ ndpi_int_http_add_connection(ndpi_struct, flow, packet->detected_protocol_stack[0], NDPI_PROTOCOL_CATEGORY_WEB);
+ }
}
/* ************************************************************* */