Fix for missing line breaks in CSV file
If "-v" is used as an argument, the line breaks are missing in the csv file ("-C"), because the argument "-J" is assumed. Moving the condition for the CSV file handler out of the scope of the "enable_joy_stats" condition removes this dependency and the CSV file is formatted correctly.
This commit is contained in:
@@ -1146,10 +1146,11 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
|
|||||||
if(enable_joy_stats) {
|
if(enable_joy_stats) {
|
||||||
/* Print entropy values for monitored flows. */
|
/* Print entropy values for monitored flows. */
|
||||||
flowGetBDMeanandVariance(flow);
|
flowGetBDMeanandVariance(flow);
|
||||||
if(csv_fp) fprintf(csv_fp, "\n");
|
|
||||||
fflush(out);
|
fflush(out);
|
||||||
fprintf(out, "[score: %.4f]", flow->entropy.score);
|
fprintf(out, "[score: %.4f]", flow->entropy.score);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(csv_fp) fprintf(csv_fp, "\n");
|
||||||
|
|
||||||
fprintf(out, "[proto: ");
|
fprintf(out, "[proto: ");
|
||||||
if(flow->tunnel_type != ndpi_no_tunnel)
|
if(flow->tunnel_type != ndpi_no_tunnel)
|
||||||
|
|||||||
Reference in New Issue
Block a user