Revision: 14814
Author: adrian.chadd
Date: Thu Oct 21 18:46:35 2010
Log: Make the regex daemon now require concurrency.


http://code.google.com/p/lusca-cache/source/detail?r=14814

Modified:
 /playpen/LUSCA_HEAD_ipv6/helpers/external_acl/regex/regex.c

=======================================
--- /playpen/LUSCA_HEAD_ipv6/helpers/external_acl/regex/regex.c Tue Aug 31 09:02:21 2010 +++ /playpen/LUSCA_HEAD_ipv6/helpers/external_acl/regex/regex.c Thu Oct 21 18:46:35 2010
@@ -194,6 +194,8 @@
 {
        const char *fn;
        char buf[HELPERBUFSZ];
+       char url[HELPERBUFSZ];
+       int seqnum;
        time_t ts;
        int r;
        struct stat sb;
@@ -236,17 +238,21 @@
                        break;
                trim_trailing_crlf(buf);
                if (debug) fprintf(stderr, "read: %s\n", buf);
-               /* XXX should break out JUST the URL here! */
+
+               /* Split out the seqnum and URL */
+               sscanf(buf, "%d %s", &seqnum, url);
+               if (debug) fprintf(stderr, "seqnum: %d; url: '%s'\n", seqnum, 
url);
+
                /* XXX and the URL should be unescaped and normalised properly 
*/
-               r = re_lookup(buf);
+               r = re_lookup(url);
                if (r > 0) {
                        if (debug) fprintf(stderr, "HIT: line %d; rule %s\n",
                            re_list.r[r].linenum, re_list.r[r].entry);
-                       printf("ERR message=line%s%d log=line%s%d\n",
+                       printf("%d ERR message=line%s%d log=line%s%d\n", seqnum,
                            "%20", re_list.r[r].linenum,
                            "%20", re_list.r[r].linenum);
                } else {
-                       printf("OK\n");
+                       printf("%d OK\n", seqnum);
                }
        }
        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.

Reply via email to