Changeset 652 for trunk/zoo-project/zoo-services
- Timestamp:
- Jun 11, 2015, 3:07:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-services/utils/status/service.c
r643 r652 65 65 tmpMmap=tmpTmap; 66 66 xmlInitParser(); 67 struct dirent *dp;68 DIR *dirp = opendir(tmpTmap->value);69 char fileName[1024],xslFileName[1024];70 67 int hasFile=-1; 71 if(dirp!=NULL){ 72 char tmp[128]; 73 sprintf(tmp,"_%s.xml",tmpMap->value); 74 while ((dp = readdir(dirp)) != NULL){ 75 #ifdef DEBUG 76 fprintf(stderr,"File : %s searched : %s\n",dp->d_name,tmp); 77 #endif 78 if(strstr(dp->d_name,"final_")==0 && strstr(dp->d_name,tmp)!=0){ 79 sprintf(fileName,"%s/%s",tmpTmap->value,dp->d_name); 80 hasFile=1; 81 break; 82 } 83 } 84 }else{ 85 char tmp[1024]; 86 snprintf(tmp,1024,_ss("GetStatus was unable to use the tmpPath value set in main.cfg file as directory %s."),tmpTmap->value); 87 setMapInMaps(conf,"lenv","message",tmp); 88 return SERVICE_FAILED; 89 } 90 if(hasFile<0){ 68 char xslFileName[1024]; 69 char* mem=_getStatusFile(conf,tmpMap->value); 70 if(mem==NULL){ 91 71 char tmp[1024]; 92 72 snprintf(tmp,1024,_ss("GetStatus was unable to find any cache file for Service ID %s."),tmpMap->value); … … 100 80 xmlDocPtr doc, res; 101 81 cur = xsltParseStylesheetFile(BAD_CAST xslFileName); 102 doc = xmlParseFile(fileName); 82 doc = xmlParseMemory(mem,strlen(mem)); 83 //doc = xmlParseFile(fileName); 103 84 if(cur!=NULL && doc!=NULL){ 104 85 /** 105 86 * Parse Status to extract Status / Message 106 87 */ 107 char *tmpStr=_getStatus(conf, atoi(tmpMap->value));88 char *tmpStr=_getStatus(conf,tmpMap->value); 108 89 #ifdef DEBUG 109 90 fprintf(stderr,"DEBUG: %s \n",tmpStr);
Note: See TracChangeset
for help on using the changeset viewer.