Browse Source

[Fix] Fix parser

tags/1.3.0
Vsevolod Stakhov 8 years ago
parent
commit
e386655418
2 changed files with 11 additions and 3 deletions
  1. 1
    1
      src/ragel/smtp_date.rl
  2. 10
    2
      utils/received_parser_bench.c

+ 1
- 1
src/ragel/smtp_date.rl View File

minute = digit_2; minute = digit_2;
second = digit_2; second = digit_2;
time_of_day = hour ":" minute (":" second )?; time_of_day = hour ":" minute (":" second )?;
zone = FWS ("+" | "-") >Sign_Start %Sign_End digit_4;
zone = FWS ("+" | "-") digit_4;
time = time_of_day zone; time = time_of_day zone;
date_time = (day_of_week ",")? date time; date_time = (day_of_week ",")? date time;
}%% }%%

+ 10
- 2
utils/received_parser_bench.c View File

static gint total_real_ip = 0; static gint total_real_ip = 0;
static gint total_real_host = 0; static gint total_real_host = 0;
static gint total_known_proto = 0; static gint total_known_proto = 0;
static gint total_known_ts = 0;


static void static void
rspamd_process_file (const gchar *fname) rspamd_process_file (const gchar *fname)
if (rh.by_hostname) { if (rh.by_hostname) {
total_valid ++; total_valid ++;
} }

if (rh.timestamp != 0) {
total_known_ts ++;
}
} }


if (err) { if (err) {
"Total valid (has by part): %d\n" "Total valid (has by part): %d\n"
"Total real ip: %d\n" "Total real ip: %d\n"
"Total real host: %d\n" "Total real host: %d\n"
"Total known proto: %d\n",
"Total known proto: %d\n"
"Total known timestamp: %d\n",
total_parsed, total_time, total_parsed, total_time,
total_valid, total_real_ip, total_real_host, total_known_proto);
total_valid, total_real_ip,
total_real_host, total_known_proto,
total_known_ts);


return 0; return 0;
} }

Loading…
Cancel
Save