diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2025-02-04 15:31:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-04 15:31:28 +0100 |
commit | 07eb92fa44e17f9c9d8c3f39e7ba054a6aad09e8 (patch) | |
tree | 0a71af356b319c2f931b1263205544bb111b94a3 /src/lib/protocols/http.c | |
parent | 642cf5764aaba1eedad5b097b2a487e1dc055c30 (diff) |
Preliminary work to rework `struct ndpi_flow_struct` (#2705)
No significant changes:
* Move around some fields to avoid holes in the structures.
* Some fields are about protocols based only on TCP.
* Remove some unused (or set but never read) fields.
See #2631
Diffstat (limited to 'src/lib/protocols/http.c')
-rw-r--r-- | src/lib/protocols/http.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index ffc0b9213..319677fe3 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -281,7 +281,7 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo u_int app_len_avail = packet->content_line.len-app_len; if(strncasecmp(app, "mpeg", app_len_avail) == 0) { - flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_STREAMING; + flow->category = NDPI_PROTOCOL_CATEGORY_STREAMING; return(flow->category); } else { if(app_len_avail > 3) { @@ -301,7 +301,7 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo if(strncasecmp(app, cmp_mimes[i], app_len_avail) == 0) { char str[64]; - flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT; + flow->category = NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT; NDPI_LOG_INFO(ndpi_struct, "found HTTP file transfer"); snprintf(str, sizeof(str), "Found binary mime %s", cmp_mimes[i]); @@ -330,7 +330,7 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo char str[64]; snprintf(str, sizeof(str), "Found mime exe %s", cmp_mimes[i]); - flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT; + flow->category = NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT; ndpi_set_binary_application_transfer(ndpi_struct, flow, str); NDPI_LOG_INFO(ndpi_struct, "Found executable HTTP transfer"); } @@ -393,7 +393,7 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo binary_exec_file_ext[i], ATTACHMENT_LEN) == 0) { snprintf(str, sizeof(str), "Found file extn %s", binary_exec_file_ext[i]); - flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT; + flow->category = NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT; ndpi_set_binary_application_transfer(ndpi_struct, flow, str); NDPI_LOG_INFO(ndpi_struct, "found executable HTTP transfer"); return(flow->category); @@ -413,13 +413,13 @@ static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_mo case 'a': if(strncasecmp((const char *)packet->content_line.ptr, "audio", ndpi_min(packet->content_line.len, 5)) == 0) - flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_MEDIA; + flow->category = NDPI_PROTOCOL_CATEGORY_MEDIA; break; case 'v': if(strncasecmp((const char *)packet->content_line.ptr, "video", ndpi_min(packet->content_line.len, 5)) == 0) - flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_MEDIA; + flow->category = NDPI_PROTOCOL_CATEGORY_MEDIA; break; } } @@ -1106,7 +1106,7 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_ packet->content_line.len); flow->http.content_type[packet->content_line.len] = '\0'; - flow->guessed_category = flow->category = ndpi_http_check_content(ndpi_struct, flow); + flow->category = ndpi_http_check_content(ndpi_struct, flow); } } } |