-const char parsers_rcs[] = "$Id: parsers.c,v 1.97 2007/04/15 16:39:21 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.98 2007/04/17 18:32:10 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.98 2007/04/17 18:32:10 fabiankeil
+ * - Make tagging based on tags set by earlier taggers
+ * of the same kind possible.
+ * - Log whether or not new tags cause action bits updates
+ * (in which case a matching tag-pattern section exists).
+ * - Log if the user tries to set a tag that is already set.
+ *
* Revision 1.97 2007/04/15 16:39:21 fabiankeil
* Introduce tags as alternative way to specify which
* actions apply to a request. At the moment tags can be
#include "miscutil.h"
#include "list.h"
#include "actions.h"
+#include "filters.h"
#ifndef HAVE_STRPTIME
#include "strptime.h"
err = header_tagger(csp, h->str);
}
- /*
- * header_tagger already updated the action bits
- * for every new tag, but unless I'm confused,
- * updating them again after all tags are collected,
- * should give us another level of indirection when
- * it comes to tagging based on tags which were set
- * by tag sections which were active because of other
- * tag sections themselves (or something like this).
- */
- update_action_bits_for_all_tags(csp);
-
return err;
}
char *modified_tag = NULL;
char *tag = header;
size_t size = header_length;
+ pcrs_job *joblist = b->joblist;
+
+ if (b->dynamic) joblist = compile_dynamic_pcrs_job_list(csp, b);
- if (NULL == b->joblist)
+ if (NULL == joblist)
{
log_error(LOG_LEVEL_RE_FILTER,
"Tagger %s has empty joblist. Nothing to do.", b->name);
}
/* execute their pcrs_joblist on the header. */
- for (job = b->joblist; NULL != job; job = job->next)
+ for (job = joblist; NULL != job; job = job->next)
{
const int hits = pcrs_execute(job, tag, size, &modified_tag, &size);
}
}
+ if (b->dynamic) pcrs_free_joblist(joblist);
+
/* If this tagger matched */
if (tag != header)
{
if (strcmp(b->name, filtername->str) == 0)
{
int current_hits = 0;
+ pcrs_job *joblist = b->joblist;
+
+ if (b->dynamic) joblist = compile_dynamic_pcrs_job_list(csp, b);
if ( NULL == b->joblist )
{
}
}
}
+
+ if (b->dynamic) pcrs_free_joblist(joblist);
+
log_error(LOG_LEVEL_RE_FILTER, "... produced %d hits (new size %d).", current_hits, size);
hits += current_hits;
}