Ignore:
Timestamp:
Jun 11, 2015, 3:07:11 PM (10 years ago)
Author:
djay
Message:

Better concurrency gesture for asynchronous requests, add db backend support for status informations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-services/utils/status/service.c

    r643 r652  
    6565      tmpMmap=tmpTmap;
    6666    xmlInitParser();
    67     struct dirent *dp;
    68     DIR *dirp = opendir(tmpTmap->value);
    69     char fileName[1024],xslFileName[1024];
    7067    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){
    9171      char tmp[1024];
    9272      snprintf(tmp,1024,_ss("GetStatus was unable to find any cache file for Service ID %s."),tmpMap->value);
     
    10080    xmlDocPtr doc, res;
    10181    cur = xsltParseStylesheetFile(BAD_CAST xslFileName);
    102     doc = xmlParseFile(fileName);
     82    doc = xmlParseMemory(mem,strlen(mem));
     83    //doc = xmlParseFile(fileName);
    10384    if(cur!=NULL && doc!=NULL){
    10485      /**
    10586       * Parse Status to extract Status / Message
    10687       */
    107       char *tmpStr=_getStatus(conf,atoi(tmpMap->value));
     88      char *tmpStr=_getStatus(conf,tmpMap->value);
    10889#ifdef DEBUG
    10990      fprintf(stderr,"DEBUG: %s \n",tmpStr);
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