Changeset 505 for trunk


Ignore:
Timestamp:
Sep 23, 2014, 4:03:07 PM (10 years ago)
Author:
djay
Message:

Fixes for metapath definition with prefixed names.

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

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_conf.y

    r503 r505  
    802802  srin = fopen(file,"r");
    803803  if (srin==NULL){
    804     fprintf(stderr,"error : file not found\n") ;
    805804    setMapInMaps(conf,"lenv","message","file not found");
    806805    return -1;
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r503 r505  
    31053105      if(tmpMap==NULL || strlen(tmpMap->value)==0){
    31063106        char *tmp01=zStrdup(tmp00->value);
     3107        tmp01[strlen(tmp01)-1]=0;
    31073108        setMapInMaps(conf,"lenv","metapath",tmp01);
    31083109        free(tmp01);
     
    31113112      else{
    31123113        if(tmp00!=NULL && tmpMap!=NULL){
    3113           char *value=(char*)malloc((strlen(tmp00->value)+strlen(tmpMap->value)+2)*sizeof(char));
    3114           sprintf(value,"%s/%s",tmpMap->value,tmp00->value);
     3114          char *tmp00s=zStrdup(tmp00->value);
     3115          tmp00s[strlen(tmp00s)-1]=0;
     3116          char *value=(char*)malloc((strlen(tmp00s)+strlen(tmpMap->value)+2)*sizeof(char));
     3117          sprintf(value,"%s/%s",tmpMap->value,tmp00s);
    31153118          setMapInMaps(conf,"lenv","metapath",value);
    31163119          free(value);
     3120          free(tmp00s);
    31173121          value=NULL;
    31183122        }
  • trunk/zoo-project/zoo-kernel/service_internal_js.c

    r492 r505  
    147147  void* cxPrivate = request;
    148148  JS_SetContextPrivate(cx,cxPrivate);
    149    
     149
    150150  map* tmpm1=getMap(request,"metapath");
    151151  char ntmp[1024];
     
    155155   * Load the first part of the ZOO-API
    156156   */
    157   char *api0=(char*)malloc(strlen(tmpm1->value)+strlen(ntmp)+17);
    158   sprintf(api0,"%s/%s/ZOO-proj4js.js",ntmp,tmpm1->value);
     157  char *api0=(char*)malloc((strlen(ntmp)+17)*sizeof(char));
     158  sprintf(api0,"%s/ZOO-proj4js.js",ntmp);
    159159#ifdef JS_DEBUG
    160160  fprintf(stderr,"Trying to load %s\n",api0);
     
    164164  fflush(stderr);
    165165
    166   char *api1=(char*)malloc(strlen(tmpm1->value)+strlen(ntmp)+13);
    167   sprintf(api1,"%s/%s/ZOO-api.js",ntmp,tmpm1->value);
     166  char *api1=(char*)malloc((strlen(ntmp)+13)*sizeof(char));
     167  sprintf(api1,"%s/ZOO-api.js",ntmp);
    168168#ifdef JS_DEBUG
    169169  fprintf(stderr,"Trying to load %s\n",api1);
  • trunk/zoo-project/zoo-kernel/service_internal_python.c

    r490 r505  
    193193  PyObject *pName, *pModule, *pFunc;
    194194  tmp=getMap(s->content,"serviceProvider");
    195   if(tmp!=NULL)
    196     pName = PyString_FromString(tmp->value);
     195  map* mp=getMap(request,"metapath");
     196  if(tmp!=NULL){
     197    if(mp!=NULL && strlen(mp->value)>0){
     198      char *mps=zStrdup(mp->value);
     199      int i,len=strlen(mps);
     200      int j=0;
     201      for(i=0;i<len;i++){
     202        if(mps[i]=='/'){
     203          mps[i]='.';
     204        }
     205      }
     206      char *mn=(char*)malloc((strlen(mps)+strlen(tmp->value)+2)*sizeof(char));
     207      sprintf(mn,"%s.%s",mps,tmp->value);
     208      pName = PyString_FromString(mn);
     209      free(mn);
     210      free(mps);
     211    }
     212    else{
     213      pName = PyString_FromString(tmp->value);
     214      fprintf(stderr,"%s %d",tmp->value,__LINE__);
     215    }
     216  }
    197217  else{
    198218    map* err=createMap("text","Unable to parse serviceProvider please check your zcfg file.");
     
    457477#endif
    458478  }
     479  Py_DECREF(list);
    459480  return res;
    460481}
     
    507528    }
    508529  }
     530  Py_DECREF(list);
    509531  return res;
    510532}
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