[mapserver-commits] r12414 - in trunk/mapserver/mapcache: include
src
svn at osgeo.org
svn at osgeo.org
Fri Aug 26 07:23:43 EDT 2011
Author: tbonfort
Date: 2011-08-26 04:23:43 -0700 (Fri, 26 Aug 2011)
New Revision: 12414
Modified:
trunk/mapserver/mapcache/include/geocache.h
trunk/mapserver/mapcache/src/configuration.c
trunk/mapserver/mapcache/src/dimension.c
trunk/mapserver/mapcache/src/service_wms.c
Log:
updated config file
thomas.bonfort | 2011-08-02 10:48:40 +0200 (Tue, 02 Aug 2011)
Modified: trunk/mapserver/mapcache/include/geocache.h
===================================================================
--- trunk/mapserver/mapcache/include/geocache.h 2011-08-26 11:23:38 UTC (rev 12413)
+++ trunk/mapserver/mapcache/include/geocache.h 2011-08-26 11:23:43 UTC (rev 12414)
@@ -1347,13 +1347,14 @@
/**
* \brief parse the value given in the configuration
*/
- void (*parse)(geocache_context *context, geocache_dimension *dim, const char *entry);
+ void (*parse)(geocache_context *context, geocache_dimension *dim, ezxml_t node);
};
struct geocache_dimension_values {
geocache_dimension dimension;
int nvalues;
char **values;
+ int case_sensitive;
};
struct geocache_dimension_regex {
Modified: trunk/mapserver/mapcache/src/configuration.c
===================================================================
--- trunk/mapserver/mapcache/src/configuration.c 2011-08-26 11:23:38 UTC (rev 12413)
+++ trunk/mapserver/mapcache/src/configuration.c 2011-08-26 11:23:43 UTC (rev 12414)
@@ -264,7 +264,7 @@
return;
}
- dimension->parse(ctx,dimension,dimension_node->txt);
+ dimension->parse(ctx,dimension,dimension_node);
GC_CHECK_ERROR(ctx);
APR_ARRAY_PUSH(dimensions,geocache_dimension*) = dimension;
Modified: trunk/mapserver/mapcache/src/dimension.c
===================================================================
--- trunk/mapserver/mapcache/src/dimension.c 2011-08-26 11:23:38 UTC (rev 12413)
+++ trunk/mapserver/mapcache/src/dimension.c 2011-08-26 11:23:43 UTC (rev 12414)
@@ -54,7 +54,9 @@
return ret;
}
-static void _geocache_dimension_intervals_parse(geocache_context *ctx, geocache_dimension *dim, const char *entry) {
+static void _geocache_dimension_intervals_parse(geocache_context *ctx, geocache_dimension *dim,
+ ezxml_t node) {
+ const char *entry = node->txt;
int count = 1;
if(!entry || !*entry) {
ctx->set_error(ctx,400,"failed to parse dimension values: none supplied");
@@ -121,7 +123,9 @@
return ret;
}
-static void _geocache_dimension_regex_parse(geocache_context *ctx, geocache_dimension *dim, const char *entry) {
+static void _geocache_dimension_regex_parse(geocache_context *ctx, geocache_dimension *dim,
+ ezxml_t node) {
+ const char *entry = node->txt;
if(!entry || !*entry) {
ctx->set_error(ctx,400,"failed to parse dimension regex: none supplied");
return;
@@ -154,8 +158,13 @@
int i;
geocache_dimension_values *dimension = (geocache_dimension_values*)dim;
for(i=0;i<dimension->nvalues;i++) {
- if(!strcmp(*value,dimension->values[i]))
- return GEOCACHE_SUCCESS;
+ if(dimension->case_sensitive) {
+ if(!strcmp(*value,dimension->values[i]))
+ return GEOCACHE_SUCCESS;
+ } else {
+ if(!strcasecmp(*value,dimension->values[i]))
+ return GEOCACHE_SUCCESS;
+ }
}
return GEOCACHE_FAILURE;
}
@@ -171,13 +180,21 @@
return ret;
}
-static void _geocache_dimension_values_parse(geocache_context *ctx, geocache_dimension *dim, const char *entry) {
+static void _geocache_dimension_values_parse(geocache_context *ctx, geocache_dimension *dim,
+ ezxml_t node) {
int count = 1;
+ const char *entry = node->txt;
if(!entry || !*entry) {
ctx->set_error(ctx,400,"failed to parse dimension values: none supplied");
return;
}
+
geocache_dimension_values *dimension = (geocache_dimension_values*)dim;
+ const char *case_sensitive = ezxml_attr(node,"case_sensitive");
+ if(case_sensitive && !strcasecmp(case_sensitive,"true")) {
+ dimension->case_sensitive = 1;
+ }
+
char *values = apr_pstrdup(ctx->pool,entry);
char *key,*last;
for(key=values;*key;key++) if(*key == ',') count++;
Modified: trunk/mapserver/mapcache/src/service_wms.c
===================================================================
--- trunk/mapserver/mapcache/src/service_wms.c 2011-08-26 11:23:38 UTC (rev 12413)
+++ trunk/mapserver/mapcache/src/service_wms.c 2011-08-26 11:23:43 UTC (rev 12414)
@@ -781,7 +781,7 @@
dimension->name = apr_pstrdup(ctx->pool,name);
- dimension->parse(ctx,dimension,param_node->txt);
+ dimension->parse(ctx,dimension,param_node);
GC_CHECK_ERROR(ctx);
APR_ARRAY_PUSH(rule->match_params,geocache_dimension*) = dimension;
More information about the mapserver-commits
mailing list