aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c
index 548b11a..49b47f9 100644
--- a/src/config.c
+++ b/src/config.c
@@ -296,8 +296,8 @@ cb_authentication_provider(enum grecs_callback_command cmd,
}
if (strcmp(type, "file") == 0) {
- if (arg) {
- grecs_error(locus, 0, "requered argument missing");
+ if (!arg) {
+ grecs_error(locus, 0, "required argument missing");
return 1;
}
authentication_provider = authp_file;
@@ -337,6 +337,29 @@ cb_access_file(enum grecs_callback_command cmd,
*(char**)varptr = grecs_strdup(value->v.string);
return 0;
}
+
+static int
+cb_http_method(enum grecs_callback_command cmd,
+ grecs_locus_t *locus,
+ void *varptr,
+ grecs_value_t *value,
+ void *cb_data)
+{
+ if (cmd != grecs_callback_set_value) {
+ grecs_error(locus, 0, "Unexpected block statement");
+ return 1;
+ }
+ if (!value || value->type != GRECS_TYPE_STRING) {
+ grecs_error(locus, 0, "expected string value");
+ return 1;
+ }
+ if (strcasecmp(value->v.string, "post") == 0)
+ use_post = 1;
+ else if (strcasecmp(value->v.string, "get"))
+ grecs_error(&value->locus, 0, "invalid http method");
+ return 0;
+}
+
static struct grecs_keyword instance_store_kw[] = {
{ "base-url", "URL",
@@ -387,6 +410,9 @@ static struct grecs_keyword eclat_kw[] = {
grecs_type_section, GRECS_DFLT,
NULL, 0,
cb_ssl, NULL, ssl_kw },
+ { "http-method", "arg: post|get",
+ "Define HTTP method to use",
+ grecs_type_string, GRECS_DFLT, NULL, 0, cb_http_method },
{ "format", "<command: string> <format: string>",
"Set default format for <command>",
grecs_type_string, GRECS_MULT, NULL, 0, cb_format },
@@ -465,6 +491,9 @@ config_finish(struct grecs_node *tree)
exit(EX_CONFIG);
if (grecs_error_count || run_config_finish_hooks())
exit(EX_CONFIG);
+
+ if (use_post)
+ signature_version = "4";
}

Return to:

Send suggestions and report system problems to the System administrator.