Ignore:
Timestamp:
Mar 31, 2014, 10:50:26 PM (11 years ago)
Author:
djay
Message:

Fix some issue in background execution on windows platform (basic array and xlink). Fix issue #89.

File:
1 edited

Legend:

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

    r454 r458  
    478478  map *tmpPath=getMapFromMaps(m,"lenv","cwd");
    479479
     480  map *tmpReq=getMap(request_inputs,"xrequest");
    480481  if(r_inputs2!=NULL){
    481482    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);
    482483    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);
    483     }
     484  }
    484485  else{
    485486    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);
     
    492493  }
    493494  char *tmp1=zStrdup(tmp);
    494   sprintf(tmp,"zoo_loader.cgi %s \"%s\"",tmp1,sid->value);
     495  sprintf(tmp,"\"zoo_loader.cgi\" %s \"%s\"",tmp1,sid->value);
    495496 
    496497  free(dataInputsKVP);
     
    504505  sprintf(clen,"%d",strlen(tmpq));
    505506  SetEnvironmentVariable("CONTENT_LENGTH",TEXT(clen));
    506 
     507 
    507508  if( !CreateProcess( NULL,             // No module name (use command line)
    508509                      TEXT(tmp),        // Command line
     
    517518      )
    518519    {
    519       //printf("CreateProcess failed (%d).\n",GetLastError() );
    520520#ifdef DEBUG
    521521      fprintf( stderr, "CreateProcess failed (%d).\n", GetLastError() );
     
    523523      return ;
    524524    }else{
    525     //printf("CreateProcess successfull (%d).\n",GetLastError() );
    526525#ifdef DEBUG
    527526    fprintf( stderr, "CreateProcess successfull (%d).\n\n\n\n", GetLastError() );
     
    530529  CloseHandle( pi.hProcess );
    531530  CloseHandle( pi.hThread );
    532   //printf("CreateProcess finished !\n");
    533531#ifdef DEBUG
    534532  fprintf(stderr,"CreateProcess finished !\n");
     
    600598  map* fstdem=getMapFromMaps(m,"main","logPath");
    601599  if(fstdem!=NULL)
    602         fstde = freopen(fstdem->value, "a+", stderr) ;
     600    fstde = freopen(fstdem->value, "a+", stderr) ;
    603601
    604602  r_inputs=getMap(request_inputs,"language");
     
    22472245    setMapInMaps(m,"lenv","sid",test1->value);
    22482246    status=getMap(request_inputs,"status");
    2249     printf("cgiSid %s\n",cgiSid);
    22502247  }
    22512248#endif
     
    22742271      pid=0;
    22752272      cpid=atoi(cgiSid);
    2276       printf("cgiSid %s\n",cgiSid);
    2277     }
    2278     //printf("pid cpid %d %d\n",pid,cpid);
    2279     //fflush(stderr);
     2273    }
    22802274#endif
    22812275    if (pid > 0) {
     
    23042298      fprintf(stderr,"\nFILE TO STORE DATA %s\n",r_inputs->value);
    23052299#endif
    2306       freopen(flog,"w+",stderr);
     2300      freopen(flog, "w+", stderr);
    23072301      f0=freopen(fbkp , "w+", stdout);
     2302#ifndef WIN32
    23082303      fclose(stdin);
     2304#endif
    23092305      free(flog);
    23102306      /**
     
    23592355#endif
    23602356
    2361   if(((int)getpid())!=cpid){
     2357  if(((int)getpid())!=cpid || cgiSid!=NULL){
    23622358    fclose(stdout);
    23632359    fclose(stderr);
     
    23762372    char *tmps1=(char*)malloc((flen+1)*sizeof(char));
    23772373    fread(tmps1,flen,1,f2);
    2378     fwrite(tmps1,1,flen+1,f3);
     2374    fwrite(tmps1,1,flen,f3);
    23792375    fclose(f2);
    23802376    fclose(f3);
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