[mapserver-commits] r12203 - trunk/mapserver/mapcache/src

svn at osgeo.org svn at osgeo.org
Fri Aug 26 07:06:51 EDT 2011


Author: tbonfort
Date: 2011-08-26 04:06:51 -0700 (Fri, 26 Aug 2011)
New Revision: 12203

Modified:
   trunk/mapserver/mapcache/src/mod_geocache.c
Log:
add WMTS getTile implementation
thomas.bonfort | 2011-01-06 13:10:00 +0100 (Thu, 06 Jan 2011)

Modified: trunk/mapserver/mapcache/src/mod_geocache.c
===================================================================
--- trunk/mapserver/mapcache/src/mod_geocache.c	2011-08-26 11:06:46 UTC (rev 12202)
+++ trunk/mapserver/mapcache/src/mod_geocache.c	2011-08-26 11:06:51 UTC (rev 12203)
@@ -58,15 +58,15 @@
 
 int report_error(int code, geocache_context_apache_request *apache_ctx) {
    geocache_context *ctx= (geocache_context*)apache_ctx;
-   ctx->log(ctx,GEOCACHE_INFO,ctx->get_error_message(ctx));
+   char *msg = ctx->get_error_message(ctx);
+   if(!msg) {
+      msg = "an unspecified error has occured";
+   }
+   ctx->log(ctx,GEOCACHE_INFO,msg);
    if(ctx->config && ctx->config->reporting == GEOCACHE_REPORT_MSG) {
       apache_ctx->request->status = code;
       ap_set_content_type(apache_ctx->request, "text/plain");
-      if(GC_HAS_ERROR(ctx)) {
-         ap_rprintf(apache_ctx->request,"error: %s",ctx->get_error_message(ctx));
-      } else {
-         ap_rprintf(apache_ctx->request,"unspecified error");
-      }
+      ap_rprintf(apache_ctx->request,"error: %s",msg);
       return OK;
    } else {
       return code;
@@ -227,9 +227,13 @@
       if(request || GC_HAS_ERROR(global_ctx))
          break;
    }
-   if(!request || GC_HAS_ERROR(global_ctx)) {
+   if(GC_HAS_ERROR(global_ctx)) {
       return report_error(HTTP_BAD_REQUEST, apache_ctx);
    }
+   if(!request) {
+      global_ctx->set_error(global_ctx,GEOCACHE_REQUEST_ERROR,"failed to recognize request");
+      return report_error(HTTP_NOT_FOUND, apache_ctx);
+   }
 
    if(request->type == GEOCACHE_REQUEST_GET_CAPABILITIES) {
       geocache_request_get_capabilities *req_caps = (geocache_request_get_capabilities*)request;



More information about the mapserver-commits mailing list