Changeset 458 for trunk/zoo-project/zoo-kernel/zoo_service_loader.c
- Timestamp:
- Mar 31, 2014, 10:50:26 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r454 r458 478 478 map *tmpPath=getMapFromMaps(m,"lenv","cwd"); 479 479 480 map *tmpReq=getMap(request_inputs,"xrequest"); 480 481 if(r_inputs2!=NULL){ 481 482 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); 482 483 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 } 484 485 else{ 485 486 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); … … 492 493 } 493 494 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); 495 496 496 497 free(dataInputsKVP); … … 504 505 sprintf(clen,"%d",strlen(tmpq)); 505 506 SetEnvironmentVariable("CONTENT_LENGTH",TEXT(clen)); 506 507 507 508 if( !CreateProcess( NULL, // No module name (use command line) 508 509 TEXT(tmp), // Command line … … 517 518 ) 518 519 { 519 //printf("CreateProcess failed (%d).\n",GetLastError() );520 520 #ifdef DEBUG 521 521 fprintf( stderr, "CreateProcess failed (%d).\n", GetLastError() ); … … 523 523 return ; 524 524 }else{ 525 //printf("CreateProcess successfull (%d).\n",GetLastError() );526 525 #ifdef DEBUG 527 526 fprintf( stderr, "CreateProcess successfull (%d).\n\n\n\n", GetLastError() ); … … 530 529 CloseHandle( pi.hProcess ); 531 530 CloseHandle( pi.hThread ); 532 //printf("CreateProcess finished !\n");533 531 #ifdef DEBUG 534 532 fprintf(stderr,"CreateProcess finished !\n"); … … 600 598 map* fstdem=getMapFromMaps(m,"main","logPath"); 601 599 if(fstdem!=NULL) 602 600 fstde = freopen(fstdem->value, "a+", stderr) ; 603 601 604 602 r_inputs=getMap(request_inputs,"language"); … … 2247 2245 setMapInMaps(m,"lenv","sid",test1->value); 2248 2246 status=getMap(request_inputs,"status"); 2249 printf("cgiSid %s\n",cgiSid);2250 2247 } 2251 2248 #endif … … 2274 2271 pid=0; 2275 2272 cpid=atoi(cgiSid); 2276 printf("cgiSid %s\n",cgiSid); 2277 } 2278 //printf("pid cpid %d %d\n",pid,cpid); 2279 //fflush(stderr); 2273 } 2280 2274 #endif 2281 2275 if (pid > 0) { … … 2304 2298 fprintf(stderr,"\nFILE TO STORE DATA %s\n",r_inputs->value); 2305 2299 #endif 2306 freopen(flog, "w+",stderr);2300 freopen(flog, "w+", stderr); 2307 2301 f0=freopen(fbkp , "w+", stdout); 2302 #ifndef WIN32 2308 2303 fclose(stdin); 2304 #endif 2309 2305 free(flog); 2310 2306 /** … … 2359 2355 #endif 2360 2356 2361 if(((int)getpid())!=cpid ){2357 if(((int)getpid())!=cpid || cgiSid!=NULL){ 2362 2358 fclose(stdout); 2363 2359 fclose(stderr); … … 2376 2372 char *tmps1=(char*)malloc((flen+1)*sizeof(char)); 2377 2373 fread(tmps1,flen,1,f2); 2378 fwrite(tmps1,1,flen +1,f3);2374 fwrite(tmps1,1,flen,f3); 2379 2375 fclose(f2); 2380 2376 fclose(f3);
Note: See TracChangeset
for help on using the changeset viewer.