aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNardi Ivan <nardi.ivan@gmail.com>2022-10-04 19:14:41 +0200
committerToni <matzeton@googlemail.com>2022-10-04 22:17:05 +0200
commitcca585053e86b70b86c12296531a882847e8dd87 (patch)
tree745017963364ee83578783974cdecb21cc326ccb /src
parent131d53896f41d9be4de77907631bed82d0b79e63 (diff)
Fix compilation and sync utests results
Diffstat (limited to 'src')
-rw-r--r--src/include/ndpi_typedefs.h4
-rw-r--r--src/lib/ndpi_main.c2
-rw-r--r--src/lib/protocols/http.c8
3 files changed, 8 insertions, 6 deletions
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h
index a8b270b6d..b0bff8bb1 100644
--- a/src/include/ndpi_typedefs.h
+++ b/src/include/ndpi_typedefs.h
@@ -1572,8 +1572,8 @@ struct ndpi_flow_struct {
_Static_assert(sizeof(((struct ndpi_flow_struct *)0)->protos) <= 200,
"Size of the struct member protocols increased to more than 200 bytes, "
"please check if this change is necessary.");
-_Static_assert(sizeof(struct ndpi_flow_struct) <= 904,
- "Size of the flow struct increased to more than 904 bytes, "
+_Static_assert(sizeof(struct ndpi_flow_struct) <= 920,
+ "Size of the flow struct increased to more than 920 bytes, "
"please check if this change is necessary.");
#endif
#endif
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index dca58a29a..6061d6419 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -5277,7 +5277,7 @@ void ndpi_connection_tracking(struct ndpi_detection_module_struct *ndpi_str,
const struct ndpi_tcphdr *tcph = packet->tcp;
const struct ndpi_udphdr *udph = packet->udp;
- if(packet->payload_packet_len > 0) {
+ if(ndpi_str->max_payload_track_len > 0 && packet->payload_packet_len > 0) {
/* printf("LEN: %u [%s]\n", packet->payload_packet_len, packet->payload); */
if(flow->flow_payload == NULL)
diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c
index 9e6def210..80c4c8041 100644
--- a/src/lib/protocols/http.c
+++ b/src/lib/protocols/http.c
@@ -659,7 +659,7 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
flow->http.url = ndpi_malloc(len);
if(flow->http.url) {
- u_int offset = 0;
+ u_int offset = 0, host_end = 0;
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_HTTP_CONNECT) {
strncpy(flow->http.url, (char*)packet->http_url_name.ptr,
@@ -668,8 +668,10 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
flow->http.url[packet->http_url_name.len] = '\0';
} else {
/* Check if we pass through a proxy (usually there is also the Via: ... header) */
- if(strncmp((char*)packet->http_url_name.ptr, "http://", 7) != 0)
+ if(strncmp((char*)packet->http_url_name.ptr, "http://", 7) != 0) {
strncpy(flow->http.url, (char*)packet->host_line.ptr, offset = packet->host_line.len);
+ host_end = packet->host_line.len;
+ }
if((packet->host_line.len == packet->http_url_name.len)
&& (strncmp((char*)packet->host_line.ptr,
@@ -684,7 +686,7 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
flow->http.url[offset] = '\0';
}
- ndpi_check_http_url(ndpi_struct, flow, &flow->http.url[packet->host_line.len]);
+ ndpi_check_http_url(ndpi_struct, flow, &flow->http.url[host_end]);
}
flow->http.method = ndpi_http_str2method((const char*)packet->http_method.ptr,