2
0
Fork 0

[core] Add response.status and response.header conditionals to config parser

This commit is contained in:
Thomas Porzelt 2009-09-28 21:45:57 +02:00
parent 4b94e01ecc
commit 97e54c9ee2
1 changed files with 25 additions and 0 deletions

View File

@ -893,6 +893,31 @@
return FALSE;
}
}
else if (g_str_has_prefix(str, "resp")) {
str += 4;
if (g_str_has_prefix(str, "."))
str++;
else if (g_str_has_prefix(str, "onse."))
str += 5;
else {
WARNING(srv, "unkown lvalue for condition: %s", n->data.string->str);
return FALSE;
}
if (g_str_equal(str, "status"))
lvalue = li_condition_lvalue_new(LI_COMP_RESPONSE_STATUS, NULL);
else if (g_str_equal(str, "header")) {
if (k == NULL) {
WARNING(srv, "%s", "header conditional needs a key");
return FALSE;
}
lvalue = li_condition_lvalue_new(LI_COMP_RESPONSE_HEADER, li_value_extract(k).string);
}
else {
WARNING(srv, "unkown lvalue for condition: %s", n->data.string->str);
return FALSE;
}
}
else {
WARNING(srv, "unkown lvalue for condition: %s", n->data.string->str);
return FALSE;