- Timestamp:
- Mar 16, 2016, 12:58:04 PM (9 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/request_parser.c
r745 r756 1688 1688 setMapArray(lres,"text",length,message); 1689 1689 setMapArray(lres,"locator",length,toCheck); 1690 setMapArray(lres,"code",length,"MissingParameter ");1690 setMapArray(lres,"code",length,"MissingParameterValue"); 1691 1691 } 1692 1692 free(message); … … 1754 1754 } 1755 1755 if(lres==NULL){ 1756 lres=createMap("code", "InvalidParameterValue");1756 lres=createMap("code",code); 1757 1757 addToMap(lres,"text",message); 1758 1758 addToMap(lres,"locator",locator); … … 1765 1765 setMapArray(lres,"text",length,message); 1766 1766 setMapArray(lres,"locator",length,locator); 1767 setMapArray(lres,"code",length, "InvalidParameterValue");1767 setMapArray(lres,"code",length,code); 1768 1768 } 1769 1769 } -
trunk/zoo-project/zoo-kernel/response_print.c
r747 r756 720 720 free(val); 721 721 } 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]); 722 732 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 } 727 735 } 728 736 } -
trunk/zoo-project/zoo-kernel/server_internal.c
r720 r756 237 237 */ 238 238 int 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 } 241 262 char *pToken,*saveptr; 242 pToken=strtok_r(tmp ,",",&saveptr);263 pToken=strtok_r(tmp1,",",&saveptr); 243 264 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); 257 274 return res; 258 275 }
Note: See TracChangeset
for help on using the changeset viewer.