Revision: 14756
Author: adrian.chadd
Date: Tue Aug 10 21:35:24 2010
Log: Switch around the order of match/fail - this way, matches cause errors
and can thus be logged and displayed on error pages.
http://code.google.com/p/lusca-cache/source/detail?r=14756
Modified:
/branches/LUSCA_HEAD/helpers/external_acl/regex/regex.c
=======================================
--- /branches/LUSCA_HEAD/helpers/external_acl/regex/regex.c Tue Aug 10
09:25:30 2010
+++ /branches/LUSCA_HEAD/helpers/external_acl/regex/regex.c Tue Aug 10
21:35:24 2010
@@ -3,11 +3,15 @@
*/
/*
- * This is a hackish, not-quite-finished regex external ACL helper.
- * Don't even try to use it in production yet.
- * -adrian
+ * This external_acl helper is designed for evaluating the throughput of
+ * regular expression rule matching.
+ *
+ * It takes a URL only on STDIN and returns ERR if the URL matches one of
+ * the regex rules; it returns OK otherwise.
+ *
+ * It is not designed for general production use.
+ * -- adrian
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
@@ -238,9 +242,11 @@
if (r > 0) {
if (debug) fprintf(stderr, "HIT: line %d; rule %s\n",
re_list.r[r].linenum, re_list.r[r].entry);
- printf("OK\n");
+ printf("ERR message=line%s%d log=line%s%d\n",
+ "%20", re_list.r[r].linenum,
+ "%20", re_list.r[r].linenum);
} else {
- printf("ERR\n");
+ printf("OK\n");
}
}
re_list_free();
--
You received this message because you are subscribed to the Google Groups
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/lusca-commit?hl=en.