diff options
author | Luca Deri <deri@ntop.org> | 2020-05-31 19:31:01 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2020-05-31 19:31:01 +0200 |
commit | 669b7579ff93eb22ccf9324fd19444754b5612b8 (patch) | |
tree | 0551cf6fff330745e788cb9a12186ceacb6fa9f9 /src | |
parent | a4f8d913eae021079b46949a9e444105167afe4f (diff) |
HTTP comparison optimization
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/protocols/http.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index 7db270212..9f2a59fc4 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -105,7 +105,7 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo const char *app = (const char *)&packet->content_line.ptr[app_len]; u_int app_len_avail = packet->content_line.len-app_len; - if(ndpi_strncasestr(app, "mpeg", app_len_avail) != NULL) { + if(strncasecmp(app, "mpeg", app_len_avail) == 0) { flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_STREAMING; return(flow->category); } else if(app_len_avail > 3) { @@ -121,7 +121,7 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo u_int8_t i; for(i = 0; cmp_mimes[i] != NULL; i++) { - if(ndpi_strncasestr(app, cmp_mimes[i], app_len_avail) != NULL) { + if(strncasecmp(app, cmp_mimes[i], app_len_avail) == 0) { flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT; NDPI_SET_BIT(flow->risk, NDPI_BINARY_APPLICATION_TRANSFER); NDPI_LOG_INFO(ndpi_struct, "found executable HTTP transfer"); |