From 257ec7cc5f372d26cba1a7178589a085116f54b0 Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 29 Dec 2019 08:07:35 +0100 Subject: Removed disable_metadata_export preference that is no longer useful since ndpi_process_extra_packet() can drive limited or full metadata export --- src/lib/protocols/http.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'src/lib/protocols/http.c') diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index 70ca0c389..b599b82a9 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -149,9 +149,8 @@ static void setHttpUserAgent(struct ndpi_detection_module_struct *ndpi_struct, * https://github.com/ua-parser/uap-core/blob/master/regexes.yaml */ //printf("==> %s\n", ua); - if(!ndpi_struct->disable_metadata_export) { - snprintf((char*)flow->protos.http.detected_os, sizeof(flow->protos.http.detected_os), "%s", ua); - } + snprintf((char*)flow->protos.http.detected_os, + sizeof(flow->protos.http.detected_os), "%s", ua); } /* ************************************************************* */ @@ -333,21 +332,17 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_ packet->host_line.len, packet->host_line.ptr); /* Copy result for nDPI apps */ - if(!ndpi_struct->disable_metadata_export) { - len = ndpi_min(packet->host_line.len, sizeof(flow->host_server_name)-1); - strncpy((char*)flow->host_server_name, (char*)packet->host_line.ptr, len); - flow->host_server_name[len] = '\0'; - flow->extra_packets_func = NULL; /* We're good now */ - } + len = ndpi_min(packet->host_line.len, sizeof(flow->host_server_name)-1); + strncpy((char*)flow->host_server_name, (char*)packet->host_line.ptr, len); + flow->host_server_name[len] = '\0'; + flow->extra_packets_func = NULL; /* We're good now */ flow->server_id = flow->dst; if(packet->forwarded_line.ptr) { len = ndpi_min(packet->forwarded_line.len, sizeof(flow->protos.http.nat_ip)-1); - if(!ndpi_struct->disable_metadata_export) { - strncpy((char*)flow->protos.http.nat_ip, (char*)packet->forwarded_line.ptr, len); - flow->protos.http.nat_ip[len] = '\0'; - } + strncpy((char*)flow->protos.http.nat_ip, (char*)packet->forwarded_line.ptr, len); + flow->protos.http.nat_ip[len] = '\0'; } ndpi_http_parse_subprotocol(ndpi_struct, flow); -- cgit v1.2.3