[mapserver-commits] r12436 - in trunk/mapserver/mapcache: . include src

svn at osgeo.org svn at osgeo.org
Fri Aug 26 07:25:56 EDT 2011


Author: tbonfort
Date: 2011-08-26 04:25:56 -0700 (Fri, 26 Aug 2011)
New Revision: 12436

Modified:
   trunk/mapserver/mapcache/geocache.xml
   trunk/mapserver/mapcache/include/geocache.h
   trunk/mapserver/mapcache/src/core.c
   trunk/mapserver/mapcache/src/service_wms.c
Log:
be more verbose on sqlite failed setup
thomas.bonfort | 2011-08-17 13:29:03 +0200 (Wed, 17 Aug 2011)

Modified: trunk/mapserver/mapcache/geocache.xml
===================================================================
--- trunk/mapserver/mapcache/geocache.xml	2011-08-26 11:25:33 UTC (rev 12435)
+++ trunk/mapserver/mapcache/geocache.xml	2011-08-26 11:25:56 UTC (rev 12436)
@@ -665,7 +665,7 @@
          <abstract>see http://mapserver-utils.googlecode.com</abstract>
       </metadata>
       <source>osm</source>
-      <cache>memcache</cache>
+      <cache>disk</cache>
       <format>PNG</format>
       <grid>FXX</grid>
       <grid>MILLER</grid>
@@ -710,14 +710,12 @@
            tilesets, and can optionally forward all the rest to (an)other server(s)
            TODO: this needs way more documenting
       -->
-      <!--
       <forwarding_rule name="foo rule">
             <append_pathinfo>true</append_pathinfo>
             <http>
                <url>http://localhost/</url>
             </http>
       </forwarding_rule>
-      -->
    </service>
    <service type="wmts" enabled="true"/>
    <service type="tms" enabled="true"/>

Modified: trunk/mapserver/mapcache/include/geocache.h
===================================================================
--- trunk/mapserver/mapcache/include/geocache.h	2011-08-26 11:25:33 UTC (rev 12435)
+++ trunk/mapserver/mapcache/include/geocache.h	2011-08-26 11:25:56 UTC (rev 12436)
@@ -496,12 +496,14 @@
    geocache_request request;
    geocache_http *http;
    apr_table_t *params;
+   char *pathinfo;
 };
 
 struct geocache_forwarding_rule {
    char *name;
    geocache_http *http;
    apr_array_header_t *match_params;  /* actually those are geocache_dimensions */
+   int append_pathinfo;
 };
 
 

Modified: trunk/mapserver/mapcache/src/core.c
===================================================================
--- trunk/mapserver/mapcache/src/core.c	2011-08-26 11:25:33 UTC (rev 12435)
+++ trunk/mapserver/mapcache/src/core.c	2011-08-26 11:25:56 UTC (rev 12436)
@@ -132,7 +132,12 @@
 
     response->data = geocache_buffer_create(30000,ctx->pool);
     response->headers = apr_table_make(ctx->pool,1);
-    geocache_http_do_request_with_params(ctx,req_proxy->http,req_proxy->params,response->data,response->headers);
+    geocache_http *http = req_proxy->http;
+    if(req_proxy->pathinfo) {
+      http = geocache_http_clone(ctx,http);
+      http->url = apr_pstrcat(ctx->pool,http->url,req_proxy->pathinfo,NULL);
+    }
+    geocache_http_do_request_with_params(ctx,http,req_proxy->params,response->data,response->headers);
     return response;
 }
 

Modified: trunk/mapserver/mapcache/src/service_wms.c
===================================================================
--- trunk/mapserver/mapcache/src/service_wms.c	2011-08-26 11:25:33 UTC (rev 12435)
+++ trunk/mapserver/mapcache/src/service_wms.c	2011-08-26 11:25:56 UTC (rev 12436)
@@ -713,6 +713,11 @@
             (*request)->type = GEOCACHE_REQUEST_PROXY;
             req_proxy->http = rule->http;
             req_proxy->params = params;
+            if(rule->append_pathinfo) {
+               req_proxy->pathinfo = pathinfo;
+            } else {
+               req_proxy->pathinfo = NULL;
+            }
             return;
          }
       }
@@ -727,9 +732,10 @@
       return;
    }
 #ifdef DEBUG
-   if((*request)->type != GEOCACHE_REQUEST_GET_TILE && (*request)->type != GEOCACHE_REQUEST_GET_MAP &&
-         (*request)->type != GEOCACHE_REQUEST_GET_CAPABILITIES &&
-         (*request)->type != GEOCACHE_REQUEST_GET_FEATUREINFO  ) {
+   if((*request)->type != GEOCACHE_REQUEST_GET_TILE &&
+         (*request)->type != GEOCACHE_REQUEST_GET_MAP && 
+         (*request)->type != GEOCACHE_REQUEST_GET_FEATUREINFO && 
+         (*request)->type != GEOCACHE_REQUEST_GET_CAPABILITIES) {
       ctx->set_error(ctx,500,"BUG: request not gettile or getmap");
       return;
    }
@@ -747,6 +753,12 @@
       rule->name = apr_pstrdup(ctx->pool,name);
       rule->match_params = apr_array_make(ctx->pool,1,sizeof(geocache_dimension*));
 
+      ezxml_t pathinfo_node = ezxml_child(rule_node,"append_pathinfo");
+      if(pathinfo_node && !strcasecmp(pathinfo_node->txt,"true")) {
+         rule->append_pathinfo = 1;
+      } else {
+         rule->append_pathinfo = 0;
+      }
       ezxml_t http_node = ezxml_child(rule_node,"http");
       if(!http_node) {
          ctx->set_error(ctx,500,"rule \"%s\" does not contain an <http> block",name);



More information about the mapserver-commits mailing list