Changeset 756


Ignore:
Timestamp:
Mar 16, 2016, 12:58:04 PM (9 years ago)
Author:
djay
Message:

Remove prefix for storeSupported and statusSupported for 1.0.0. Fix isValidLang function. Fix error code to MissingParameterValue? or any other relevant code.

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

Legend:

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

    r745 r756  
    16881688        setMapArray(lres,"text",length,message);
    16891689        setMapArray(lres,"locator",length,toCheck);
    1690         setMapArray(lres,"code",length,"MissingParameter");
     1690        setMapArray(lres,"code",length,"MissingParameterValue");
    16911691      }
    16921692      free(message);
     
    17541754      }
    17551755      if(lres==NULL){
    1756         lres=createMap("code","InvalidParameterValue");
     1756        lres=createMap("code",code);
    17571757        addToMap(lres,"text",message);
    17581758        addToMap(lres,"locator",locator);       
     
    17651765        setMapArray(lres,"text",length,message);
    17661766        setMapArray(lres,"locator",length,locator);
    1767         setMapArray(lres,"code",length,"InvalidParameterValue");
     1767        setMapArray(lres,"code",length,code);
    17681768      }
    17691769    }
  • trunk/zoo-project/zoo-kernel/response_print.c

    r747 r756  
    720720        free(val);
    721721      }
     722      else{
     723        if(vid==0 && i>=2)
     724          xmlNewProp(n,BAD_CAST capabilities[vid][i],BAD_CAST tmp1->value);
     725        else
     726          xmlNewNsProp(n,ns,BAD_CAST capabilities[vid][i],BAD_CAST tmp1->value);
     727      }
     728    }
     729    else{
     730      if(vid==0 && i>=2)
     731        xmlNewProp(n,BAD_CAST capabilities[vid][i],BAD_CAST capabilities[vid][i+1]);
    722732      else
    723         xmlNewNsProp(n,ns,BAD_CAST capabilities[vid][i],BAD_CAST tmp1->value);
    724     }
    725     else
    726       xmlNewNsProp(n,ns,BAD_CAST capabilities[vid][i],BAD_CAST capabilities[vid][i+1]);
     733        xmlNewNsProp(n,ns,BAD_CAST capabilities[vid][i],BAD_CAST capabilities[vid][i+1]);
     734    }
    727735  }
    728736}
  • trunk/zoo-project/zoo-kernel/server_internal.c

    r720 r756  
    237237 */
    238238int isValidLang(maps* conf,const char *str){
    239   map *tmpMap=getMapFromMaps(conf,"main","lang");
    240   char *tmp=zStrdup(tmpMap->value);
     239  map *tmpMap=getMapFromMaps(conf,"main","language");
     240  char *tmp0=NULL,*tmp=NULL,*tmp1=NULL;
     241  if(tmpMap!=NULL)
     242    tmp0=zStrdup(tmpMap->value);
     243  tmpMap=getMapFromMaps(conf,"main","lang");
     244  if(tmpMap!=NULL)
     245    tmp=zStrdup(tmpMap->value);
     246  if(tmp0!=NULL && tmp!=NULL){
     247    tmp1=(char*)malloc((strlen(tmp0)+strlen(tmp)+2)*sizeof(char));
     248    sprintf(tmp1,"%s,%s",tmp0,tmp);
     249    free(tmp0);
     250    free(tmp);
     251  }else{
     252    if(tmp!=NULL){
     253      tmp1==zStrdup(tmp);
     254      free(tmp);
     255    }else{
     256      if(tmp0!=NULL){
     257        tmp1==zStrdup(tmp0);
     258        free(tmp0);
     259      }
     260    }
     261  }
    241262  char *pToken,*saveptr;
    242   pToken=strtok_r(tmp,",",&saveptr);
     263  pToken=strtok_r(tmp1,",",&saveptr);
    243264  int res=-1;
    244   char *pToken1,*saveptr1;
    245   pToken1=strtok_r(tmp,",",&saveptr1);
    246   while(pToken1!=NULL){
    247     while(pToken!=NULL){
    248       if(strcasecmp(pToken1,pToken)==0){
    249         res=1;
    250         break;
    251       }
    252       pToken=strtok_r(NULL,",",&saveptr);
    253     }
    254     pToken1=strtok_r(NULL,",",&saveptr1);
    255   }
    256   free(tmp);
     265  while(pToken!=NULL){
     266    if(strcasecmp(str,pToken)==0){
     267      res=1;
     268      break;
     269    }
     270    pToken=strtok_r(NULL,",",&saveptr);
     271  }
     272  if(tmp1!=NULL)
     273    free(tmp1);
    257274  return res;
    258275}
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