Changeset 501 for trunk/zoo-project


Ignore:
Timestamp:
Sep 17, 2014, 8:49:47 PM (8 years ago)
Author:
djay
Message:

Version for testing through ogc-cite with 29 passed tests

Location:
trunk/zoo-project/zoo-kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r500 r501  
    3636#define FALSE -1
    3737#endif
     38
     39int isValidLang(maps* conf,const char *str){
     40  map *tmpMap=getMapFromMaps(conf,"main","lang");
     41  char *tmp=zStrdup(tmpMap->value);
     42  char *pToken=strtok(tmp,",");
     43  int res=-1;
     44  while(pToken!=NULL){
     45    if(strcasecmp(str,pToken)==0){
     46      res=1;
     47      break;
     48    }
     49    pToken = strtok(NULL,",");
     50  }
     51  free(tmp);
     52  return res;
     53}
    3854
    3955void printHeaders(maps* m){
  • trunk/zoo-project/zoo-kernel/service_internal.h

    r492 r501  
    9494  int getServiceFromYAML(maps*,char*,service**,char *name);
    9595  int readServiceFile(maps*, char*,service**,char *);
    96  
     96  int isValidLang(maps*,const char*);
    9797
    9898  void printHeaders(maps*);
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r498 r501  
    732732    r_inputs=getMapFromMaps(m,"main","language");
    733733  if(r_inputs!=NULL){
     734    if(isValidLang(m,r_inputs->value)<0){
     735      char tmp[1024];
     736      sprintf(tmp,_("The value %s is not supported for the <language> parameter"),
     737              r_inputs->value);
     738      errorException(m, tmp,"InvalidParameterValue","language");
     739      freeMaps(&m);
     740      free(m);
     741      free(REQUEST);
     742      return 1;
     743
     744    }
    734745    char *tmp=zStrdup(r_inputs->value);
    735746    setMapInMaps(m,"main","language",tmp);
     
    777788  if(strlen(cgiServerName)>0){
    778789    char tmpUrl[1024];
    779     sprintf(tmpUrl,"http://%s%s",cgiServerName,cgiScriptName);
     790    if(strncmp(cgiServerPort,"80",2)==0){
     791      sprintf(tmpUrl,"http://%s%s",cgiServerName,cgiScriptName);
     792    }else{
     793      sprintf(tmpUrl,"http://%s:%s%s",cgiServerName,cgiServerPort,cgiScriptName);
     794    }
    780795#ifdef DEBUG
    781796    fprintf(stderr,"*** %s ***\n",tmpUrl);
     
    803818       && strncasecmp(r_inputs->value,"DescribeProcess",15)!=0
    804819       && strncasecmp(r_inputs->value,"Execute",7)!=0){
    805       errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), "InvalidParameterValue","request");
     820      errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), "OperationNotSupported",r_inputs->value);
    806821      freeMaps(&m);
    807822      free(m);
     
    844859      }
    845860    }
     861  }else{
     862    r_inputs=getMap(request_inputs,"AcceptVersions");
     863    if(r_inputs!=NULL){
     864      if(strncmp(r_inputs->value,"1.0.0",5)!=0){
     865      errorException(m, _("Unenderstood <AcceptVersions> value, 1.0.0 is the only acceptable value."), "VersionNegotiationFailed",NULL);
     866        freeMaps(&m);
     867        free(m);
     868        free(REQUEST);
     869        return 1;
     870      }
     871    }
    846872  }
    847873
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png