- Timestamp:
- Sep 23, 2014, 4:03:07 PM (10 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_conf.y
r503 r505 802 802 srin = fopen(file,"r"); 803 803 if (srin==NULL){ 804 fprintf(stderr,"error : file not found\n") ;805 804 setMapInMaps(conf,"lenv","message","file not found"); 806 805 return -1; -
trunk/zoo-project/zoo-kernel/service_internal.c
r503 r505 3105 3105 if(tmpMap==NULL || strlen(tmpMap->value)==0){ 3106 3106 char *tmp01=zStrdup(tmp00->value); 3107 tmp01[strlen(tmp01)-1]=0; 3107 3108 setMapInMaps(conf,"lenv","metapath",tmp01); 3108 3109 free(tmp01); … … 3111 3112 else{ 3112 3113 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); 3115 3118 setMapInMaps(conf,"lenv","metapath",value); 3116 3119 free(value); 3120 free(tmp00s); 3117 3121 value=NULL; 3118 3122 } -
trunk/zoo-project/zoo-kernel/service_internal_js.c
r492 r505 147 147 void* cxPrivate = request; 148 148 JS_SetContextPrivate(cx,cxPrivate); 149 149 150 150 map* tmpm1=getMap(request,"metapath"); 151 151 char ntmp[1024]; … … 155 155 * Load the first part of the ZOO-API 156 156 */ 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); 159 159 #ifdef JS_DEBUG 160 160 fprintf(stderr,"Trying to load %s\n",api0); … … 164 164 fflush(stderr); 165 165 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); 168 168 #ifdef JS_DEBUG 169 169 fprintf(stderr,"Trying to load %s\n",api1); -
trunk/zoo-project/zoo-kernel/service_internal_python.c
r490 r505 193 193 PyObject *pName, *pModule, *pFunc; 194 194 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 } 197 217 else{ 198 218 map* err=createMap("text","Unable to parse serviceProvider please check your zcfg file."); … … 457 477 #endif 458 478 } 479 Py_DECREF(list); 459 480 return res; 460 481 } … … 507 528 } 508 529 } 530 Py_DECREF(list); 509 531 return res; 510 532 }
Note: See TracChangeset
for help on using the changeset viewer.