]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix parser
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 15 Jun 2016 08:26:38 +0000 (09:26 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 15 Jun 2016 08:26:38 +0000 (09:26 +0100)
src/ragel/smtp_date.rl
utils/received_parser_bench.c

index da5872439ea4f7fe9beaa15adae5f9036fe70325..eb5d0cdc528ddb037fc3c5ec2f087db97056af76 100644 (file)
@@ -21,7 +21,7 @@
   minute          =   digit_2;
   second          =   digit_2;
   time_of_day     =   hour ":" minute (":" second )?;
-  zone            =   FWS ("+" | "-") >Sign_Start %Sign_End digit_4;
+  zone            =   FWS ("+" | "-") digit_4;
   time            =   time_of_day zone;
   date_time       =   (day_of_week ",")? date time;
 }%%
\ No newline at end of file
index 18c48ee1052561beb93f6ec38f5266e115e47148..4f6a073fdc863204234b1a8015923a090d2355d1 100644 (file)
@@ -25,6 +25,7 @@ static gint total_valid = 0;
 static gint total_real_ip = 0;
 static gint total_real_host = 0;
 static gint total_known_proto = 0;
+static gint total_known_ts = 0;
 
 static void
 rspamd_process_file (const gchar *fname)
@@ -77,6 +78,10 @@ rspamd_process_file (const gchar *fname)
                if (rh.by_hostname) {
                        total_valid ++;
                }
+
+               if (rh.timestamp != 0) {
+                       total_known_ts ++;
+               }
        }
 
        if (err) {
@@ -105,9 +110,12 @@ main (int argc, char **argv)
                        "Total valid (has by part): %d\n"
                        "Total real ip: %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_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;
 }