http: create a common function to parse User Agent field

Prepare the code to handle UA information from flows other than HTTP
This commit is contained in:
Nardi Ivan
2020-09-08 10:34:05 +02:00
parent 601928cc8e
commit a1014e8895
3 changed files with 95 additions and 81 deletions
+3 -3
View File
@@ -1268,11 +1268,11 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
if(flow->http.content_type[0] != '\0')
fprintf(out, "[Content-Type: %s]", flow->http.content_type);
if(flow->http.user_agent[0] != '\0')
fprintf(out, "[User-Agent: %s]", flow->http.user_agent);
}
if(flow->http.user_agent[0] != '\0')
fprintf(out, "[User-Agent: %s]", flow->http.user_agent);
if(flow->risk) {
u_int i;