diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/reader_util.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/example/reader_util.c b/example/reader_util.c index dec8e1216..d36c42a16 100644 --- a/example/reader_util.c +++ b/example/reader_util.c @@ -1116,11 +1116,7 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl flow->http.response_status_code = flow->ndpi_flow->http.response_status_code; ndpi_snprintf(flow->http.content_type, sizeof(flow->http.content_type), "%s", flow->ndpi_flow->http.content_type ? flow->ndpi_flow->http.content_type : ""); ndpi_snprintf(flow->http.request_content_type, sizeof(flow->http.request_content_type), "%s", flow->ndpi_flow->http.request_content_type ? flow->ndpi_flow->http.request_content_type : ""); - ndpi_snprintf(flow->http.user_agent, sizeof(flow->http.user_agent), "%s", flow->ndpi_flow->http.user_agent ? flow->ndpi_flow->http.user_agent : ""); } - } else if(is_ndpi_proto(flow, NDPI_PROTOCOL_SSDP) || - is_ndpi_proto(flow, NDPI_PROTOCOL_XIAOMI)) { - ndpi_snprintf(flow->http.user_agent, sizeof(flow->http.user_agent), "%s", flow->ndpi_flow->http.user_agent ? flow->ndpi_flow->http.user_agent : ""); } else if(is_ndpi_proto(flow, NDPI_PROTOCOL_TELNET)) { if(flow->ndpi_flow->protos.telnet.username[0] != '\0') flow->telnet.username = ndpi_strdup(flow->ndpi_flow->protos.telnet.username); @@ -1145,8 +1141,6 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl ) { flow->ssh_tls.ssl_version = flow->ndpi_flow->protos.tls_quic.ssl_version; - ndpi_snprintf(flow->http.user_agent, sizeof(flow->http.user_agent), "%s", flow->ndpi_flow->http.user_agent ? flow->ndpi_flow->http.user_agent : ""); - if(flow->ndpi_flow->protos.tls_quic.server_names_len > 0 && flow->ndpi_flow->protos.tls_quic.server_names) flow->ssh_tls.server_names = ndpi_strdup(flow->ndpi_flow->protos.tls_quic.server_names); @@ -1224,6 +1218,10 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl } } + ndpi_snprintf(flow->http.user_agent, + sizeof(flow->http.user_agent), + "%s", (flow->ndpi_flow->http.user_agent ? flow->ndpi_flow->http.user_agent : "")); + if(flow->detection_completed && (!flow->check_extra_packets)) { if(is_ndpi_proto(flow, NDPI_PROTOCOL_UNKNOWN)) { if(workflow->__flow_giveup_callback != NULL) |