Changeset 503 for trunk/zoo-project/zoo-kernel/zoo_service_loader.c
- Timestamp:
- Sep 22, 2014, 6:36:15 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r502 r503 988 988 while(tmps!=NULL){ 989 989 int hasVal=-1; 990 char *corig= strdup(tmps);990 char *corig=zStrdup(tmps); 991 991 if(strstr(corig,".")!=NULL){ 992 992 993 parseIdentifier(m,conf_dir,corig,buff1); 994 map* tmpMap=getMapFromMaps(m,"lenv","metapath"); 995 if(tmpMap!=NULL) 996 addToMap(request_inputs,"metapath",tmpMap->value); 997 993 998 s1=(service*)malloc(SERVICE_SIZE); 994 999 t=readServiceFile(m,buff1,&s1,corig); 995 996 1000 if(t<0){ 997 1001 map* tmp00=getMapFromMaps(m,"lenv","message"); 998 1002 char tmp01[1024]; 999 1003 if(tmp00!=NULL) 1000 sprintf(tmp01,_("Unable to parse the ZCFG file : %s (%s)"),dp->d_name,tmp00->value);1004 sprintf(tmp01,_("Unable to parse the ZCFG file for the following ZOO-Service: %s. Message: %s"),tmps,tmp00->value); 1001 1005 else 1002 sprintf(tmp01,_("Unable to parse the ZCFG file : %s."),dp->d_name);1006 sprintf(tmp01,_("Unable to parse the ZCFG file for the following ZOO-Service: %s."),tmps); 1003 1007 dup2(saved_stdout,fileno(stdout)); 1004 errorException(m, tmp01,"In ternalError",NULL);1008 errorException(m, tmp01,"InvalidParameterValue","identifier"); 1005 1009 freeMaps(&m); 1006 1010 free(m); 1007 1011 free(REQUEST); 1012 free(corig); 1013 free(orig); 1014 free(SERVICE_URL); 1015 free(s1); 1016 closedir(dirp); 1017 xmlFreeDoc(doc); 1018 xmlCleanupParser(); 1019 zooXmlCleanupNs(); 1008 1020 return 1; 1009 1021 } … … 1016 1028 s1=NULL; 1017 1029 scount++; 1018 setMapInMaps(m,"lenv","level","0"); 1019 } 1020 1021 memset(buff,0,256); 1022 snprintf(buff,256,"%s.zcfg",corig); 1023 free(corig); 1024 memset(buff1,0,1024); 1025 #ifdef DEBUG 1026 printf("\n#######%s\n########\n",buff); 1027 #endif 1028 while ((dp = readdir(dirp)) != NULL){ 1029 if( strcasecmp(dp->d_name,buff)==0 ){ 1030 memset(buff1,0,1024); 1031 snprintf(buff1,1024,"%s/%s",conf_dir,dp->d_name); 1032 s1=(service*)malloc(SERVICE_SIZE); 1033 if(s1 == NULL){ 1034 dup2(saved_stdout,fileno(stdout)); 1035 return errorException(m, _("Unable to allocate memory."),"InternalError",NULL); 1030 hasVal=1; 1031 }else{ 1032 memset(buff,0,256); 1033 snprintf(buff,256,"%s.zcfg",corig); 1034 free(corig); 1035 memset(buff1,0,1024); 1036 #ifdef DEBUG 1037 printf("\n#######%s\n########\n",buff); 1038 #endif 1039 while ((dp = readdir(dirp)) != NULL){ 1040 if( strcasecmp(dp->d_name,buff)==0 ){ 1041 memset(buff1,0,1024); 1042 snprintf(buff1,1024,"%s/%s",conf_dir,dp->d_name); 1043 s1=(service*)malloc(SERVICE_SIZE); 1044 if(s1 == NULL){ 1045 dup2(saved_stdout,fileno(stdout)); 1046 return errorException(m, _("Unable to allocate memory."),"InternalError",NULL); 1047 } 1048 #ifdef DEBUG 1049 printf("#################\n(%s) %s\n#################\n",r_inputs->value,buff1); 1050 #endif 1051 char *tmp0=zStrdup(dp->d_name); 1052 tmp0[strlen(tmp0)-5]=0; 1053 t=readServiceFile(m,buff1,&s1,tmp0); 1054 free(tmp0); 1055 if(t<0){ 1056 map* tmp00=getMapFromMaps(m,"lenv","message"); 1057 char tmp01[1024]; 1058 if(tmp00!=NULL) 1059 sprintf(tmp01,_("Unable to parse the ZCFG file: %s (%s)"),dp->d_name,tmp00->value); 1060 else 1061 sprintf(tmp01,_("Unable to parse the ZCFG file: %s."),dp->d_name); 1062 dup2(saved_stdout,fileno(stdout)); 1063 errorException(m, tmp01,"InternalError",NULL); 1064 freeMaps(&m); 1065 free(m); 1066 free(orig); 1067 free(REQUEST); 1068 closedir(dirp); 1069 xmlFreeDoc(doc); 1070 xmlCleanupParser(); 1071 zooXmlCleanupNs(); 1072 return 1; 1073 } 1074 #ifdef DEBUG 1075 dumpService(s1); 1076 #endif 1077 printDescribeProcessForProcess(m,n,s1); 1078 freeService(&s1); 1079 free(s1); 1080 s1=NULL; 1081 scount++; 1082 hasVal=1; 1036 1083 } 1037 #ifdef DEBUG1038 printf("#################\n(%s) %s\n#################\n",r_inputs->value,buff1);1039 #endif1040 char *tmp0=zStrdup(dp->d_name);1041 tmp0[strlen(tmp0)-5]=0;1042 t=readServiceFile(m,buff1,&s1,tmp0);1043 free(tmp0);1044 if(t<0){1045 map* tmp00=getMapFromMaps(m,"lenv","message");1046 char tmp01[1024];1047 if(tmp00!=NULL)1048 sprintf(tmp01,_("Unable to parse the ZCFG file: %s (%s)"),dp->d_name,tmp00->value);1049 else1050 sprintf(tmp01,_("Unable to parse the ZCFG file: %s."),dp->d_name);1051 dup2(saved_stdout,fileno(stdout));1052 errorException(m, tmp01,"InternalError",NULL);1053 freeMaps(&m);1054 free(m);1055 free(orig);1056 free(REQUEST);1057 closedir(dirp);1058 xmlFreeDoc(doc);1059 return 1;1060 }1061 #ifdef DEBUG1062 dumpService(s1);1063 #endif1064 printDescribeProcessForProcess(m,n,s1);1065 freeService(&s1);1066 free(s1);1067 s1=NULL;1068 scount++;1069 hasVal=1;1070 1084 } 1071 1085 } … … 1078 1092 sprintf(tmp01,_("Unable to parse the ZCFG file: %s."),buff); 1079 1093 dup2(saved_stdout,fileno(stdout)); 1094 dumpMaps(m); 1080 1095 errorException(m, tmp01,"InvalidParameterValue","Identifier"); 1081 1096 freeMaps(&m); … … 1085 1100 closedir(dirp); 1086 1101 xmlFreeDoc(doc); 1102 xmlCleanupParser(); 1103 zooXmlCleanupNs(); 1087 1104 return 1; 1088 1105 } 1106 free(corig); 1089 1107 rewinddir(dirp); 1090 1108 tmps=strtok_r(NULL,",",&saveptr);
Note: See TracChangeset
for help on using the changeset viewer.