Changeset 452 for trunk


Ignore:
Timestamp:
Jan 6, 2014, 5:53:08 PM (11 years ago)
Author:
djay
Message:

Fix issue on windows platform with shared memory, pass outputs as KVP to created process.

Location:
trunk/zoo-project/zoo-kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r451 r452  
    8080  LPWSTR lpszTmp;
    8181  BOOL fInit;
     82  char *final_string=NULL;
    8283  char *s=NULL;
     84  map *tmpMap1;
    8385  map *tmpMap=getMapFromMaps(conf,"lenv","sid");
    8486  if(hMapObjectG==NULL)
     
    106108    return ;
    107109  }
    108   if (fInit)
    109     memset(lpvMemG, '\0', SHMEMSIZE);
     110  memset(lpvMemG, '\0', SHMEMSIZE);
    110111  tmpMap=getMapFromMaps(conf,"lenv","status");
     112  tmpMap1=NULL;
     113  tmpMap1=getMapFromMaps(conf,"lenv","message");
    111114  lpszTmp = (LPWSTR) lpvMemG;
    112   for(s=tmpMap->value;*s!=NULL;s++)
     115  final_string=(char*)malloc((strlen(tmpMap1->value)+strlen(tmpMap->value)+2)*sizeof(char));
     116  sprintf(final_string,"%s|%s",tmpMap->value,tmpMap1->value);
     117  for(s=final_string;*s!='\0';*s++){
    113118    *lpszTmp++ = *s;
    114   *lpszTmp++ = '|';
    115   tmpMap=NULL;
    116   tmpMap=getMapFromMaps(conf,"lenv","message");
    117   if(tmpMap!=NULL)
    118     for(s=tmpMap->value;*s!=NULL;s++)
    119       *lpszTmp++ = *s;
    120   *lpszTmp = '\0';
     119  }
     120  *lpszTmp++ = '\0';
     121  free(final_string);
    121122}
    122123
    123124char* getStatus(int pid){
    124   LPWSTR lpszBuf=NULL;
     125  char lpszBuf[SHMEMSIZE];
     126  int i=0;
    125127  LPWSTR lpszTmp=NULL;
    126128  LPVOID lpvMem = NULL;
     
    155157    return "-1";
    156158  lpszTmp = (LPWSTR) lpvMem;
    157   return (char*)lpszTmp;
     159  while (*lpszTmp){
     160    lpszBuf[i] = (char)*lpszTmp;
     161    *lpszTmp++;
     162    lpszBuf[i+1] = '\0';
     163    i++;
     164  }
     165  fprintf(stderr,"READING STRING S %s\n",lpszBuf);
     166  return (char*)lpszBuf;
    158167}
    159168
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r445 r452  
    461461    hasIn=1;
    462462  }
    463   map* r_inputs2=getMap(s1->content,"ResponseDocument");
     463  map* r_inputs2=getMap(request_inputs,"ResponseDocument");
    464464  if(r_inputs2==NULL)
    465     r_inputs2=getMap(s1->content,"RawDataOutput");
     465    r_inputs2=getMap(request_inputs,"RawDataOutput");
    466466  map *tmpPath=getMapFromMaps(m,"lenv","cwd");
    467467
    468468  if(r_inputs2!=NULL){
    469     sprintf(tmp,"\"metapath=%s&request=%s&service=WPS&version=1.0.0&Identifier=%s&DataInputs=%s&%s=%s&cgiSid=%s\"",r_inputs1->value,req->value,id->value,dataInputsKVP,r_inputs2->name,r_inputs2->value,sid->value);
     469    sprintf(tmp,"\"metapath=%s&request=%s&service=WPS&version=1.0.0&Identifier=%s&DataInputs=%s&%s=%s&cgiSid=%s\"",r_inputs1->value,req->value,id->value,dataInputsKVP,r_inputs2->name,dataOutputsKVP,sid->value);
    470470    sprintf(tmpq,"metapath=%s&request=%s&service=WPS&version=1.0.0&Identifier=%s&DataInputs=%s&%s=%s",r_inputs1->value,req->value,id->value,dataInputsKVP,r_inputs2->name,dataOutputsKVP);
    471   }
     471    }
    472472  else{
    473473    sprintf(tmp,"\"metapath=%s&request=%s&service=WPS&version=1.0.0&Identifier=%s&DataInputs=%s&cgiSid=%s\"",r_inputs1->value,req->value,id->value,dataInputsKVP,sid->value);
     
    484484  free(dataInputsKVP);
    485485  free(dataOutputsKVP);
    486   //printf("REQUEST IS : %s \n",tmp);
    487486#ifdef DEBUG
    488487  fprintf(stderr,"REQUEST IS : %s \n",tmp);
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