From: Adam Dickmeiss Date: Fri, 7 Dec 2012 12:55:39 +0000 (+0100) Subject: limitmap local:* matches against all metadata fields X-Git-Tag: v1.6.24~17 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=2338caf3742f3414dcd1bbda7d8a7b249fca4e19;p=pazpar2-moved-to-github.git limitmap local:* matches against all metadata fields --- diff --git a/src/session.c b/src/session.c index f3e71fe..8deded8 100644 --- a/src/session.c +++ b/src/session.c @@ -1681,17 +1681,31 @@ static int check_limit_local(struct client *cl, if (!name) break; - md_field_id = conf_service_metadata_field_id(service, name); - if (md_field_id < 0) + if (!strcmp(name, "*")) { - skip_record = 1; - break; + for (md_field_id = 0; md_field_id < service->num_metadata; + md_field_id++) + { + if (match_metadata_local(record, service, md_field_id, + values, num_v)) + break; + } + if (md_field_id == service->num_metadata) + skip_record = 1; } - if (!match_metadata_local(record, service, md_field_id, - values, num_v)) + else { - skip_record = 1; - break; + md_field_id = conf_service_metadata_field_id(service, name); + if (md_field_id < 0) + { + skip_record = 1; + break; + } + if (!match_metadata_local(record, service, md_field_id, + values, num_v)) + { + skip_record = 1; + } } } nmem_destroy(nmem_tmp); diff --git a/test/test_limit_limitmap_settings_3.xml b/test/test_limit_limitmap_settings_3.xml index 43bfdee..dd27d89 100644 --- a/test/test_limit_limitmap_settings_3.xml +++ b/test/test_limit_limitmap_settings_3.xml @@ -1,5 +1,5 @@ - +