typedef struct request_data_t request_data_t;
#define REQUEST_DATA_REGEX (0xadbeef00)
+#define REQUEST_MAX_REGEX (8)
typedef struct auth_req {
#ifndef NDEBUG
REG_EXTENDED);
compare = regexec(®,
(char *)auth_item->strvalue,
- 16, rxmatch, 0);
+ REQUEST_MAX_REGEX + 1,
+ rxmatch, 0);
regfree(®);
/*
* Add %{0}, %{1}, etc.
*/
- for (i = 0; i <= 8; i++) {
+ for (i = 0; i <= REQUEST_MAX_REGEX; i++) {
char *p;
char buffer[sizeof(check_item->strvalue)];
"proxy-request",
"proxy-reply",
NULL};
+
+#if REQUEST_MAX_REGEX > 8
+#error Please fix the following line
+#endif
static int xlat_inst[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; /* up to 8 for regex */
* Register xlat's for regexes.
*/
buffer[1] = '\0';
- for (i = 0; i <= 8; i++) {
+ for (i = 0; i <= REQUEST_MAX_REGEX; i++) {
buffer[0] = '0' + i;
xlat_register(buffer, xlat_regex, &xlat_inst[i]);
c = xlat_find(buffer);