- Timestamp:
- Aug 16, 2018, 8:00:56 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c
r873 r877 68 68 #ifdef WIN32 69 69 #include "caching.h" 70 extern wchar_t**_wenviron; 70 71 #endif 71 72 … … 111 112 #include <dirent.h> 112 113 #include <signal.h> 114 #ifndef WIN32 113 115 #include <execinfo.h> 116 #endif 114 117 #include <unistd.h> 115 118 #ifndef WIN32 … … 365 368 fflush (stderr); 366 369 #endif 367 inheritance(r,&s1); 370 if(s1!=NULL) 371 inheritance(r,&s1); 368 372 func (r, m, doc, n, s1); 369 373 freeService (&s1); … … 1449 1453 r_inputs = NULL; 1450 1454 r_inputs = getMap (request_inputs, "version"); 1455 #ifdef DEBUG 1451 1456 fprintf(stderr," ** DEBUG %s %d \n",__FILE__,__LINE__); 1452 1457 fflush(stderr); 1458 #endif 1453 1459 xmlNodePtr n = printWPSHeader(doc,m,"DescribeProcess", 1454 1460 root_nodes[vid][1],(version!=NULL?version->value:"1.0.0"),1); … … 1628 1634 hasVal = 1; 1629 1635 setMapInMaps (m, "lenv", "level", "0"); 1630 /*1631 #ifdef META_DB1632 }1633 #endif1634 */1635 1636 } 1636 1637 else … … 1726 1727 addNestedOutputs(&s1); 1727 1728 #endif 1728 json_object* jobj=serviceToJson(s1);1729 /*json_object* jobj=serviceToJson(s1); 1729 1730 const char* jsonStr=json_object_to_json_string_ext(jobj,JSON_C_TO_STRING_PLAIN); 1730 fprintf(stderr,"*** %s %d %s \n",__FILE__,__LINE__,jsonStr); 1731 fprintf(stderr,"*** %s %d %s \n",__FILE__,__LINE__,jsonStr);*/ 1731 1732 1732 1733 printDescribeProcessForProcess (zooRegistry,m, doc, n, s1); … … 1942 1943 dup2 (fileno (stderr), fileno (stdout)); 1943 1944 t = readServiceFile (m, tmps1, &s1, r_inputs->value); 1944 inheritance(zooRegistry,&s1); 1945 fprintf(stderr,"%d %s %d",t,__FILE__,__LINE__); 1946 fflush(stderr); 1947 if(t>=0){ 1948 inheritance(zooRegistry,&s1); 1945 1949 #ifdef USE_HPC 1946 addNestedOutputs(&s1); 1947 #endif 1950 addNestedOutputs(&s1); 1951 #endif 1952 } 1948 1953 if(zooRegistry!=NULL){ 1949 1954 freeRegistry(&zooRegistry); … … 2254 2259 #endif 2255 2260 int ei = 1; 2256 char **orig =2261 2257 2262 #ifdef WIN32 2258 GetEnvironmentStrings() 2263 LPVOID orig = GetEnvironmentStrings(); 2264 LPTSTR s = (LPTSTR) orig; 2259 2265 #else 2260 environ 2261 #endif 2262 ; 2266 char **orig = environ; 2263 2267 char *s=*orig; 2268 #endif 2269 2264 2270 _tmpMaps = createMaps("renv"); 2265 2271 for (; s; ei++) { … … 2277 2283 free(tmpName); 2278 2284 } 2285 #ifdef WIN32 2286 s++; 2287 #else 2279 2288 s = *(orig+ei); 2289 #endif 2280 2290 } 2281 2291 if(_tmpMaps->content!=NULL && getMap(_tmpMaps->content,"HTTP_COOKIE")!=NULL){ … … 2285 2295 freeMaps (&_tmpMaps); 2286 2296 free (_tmpMaps); 2297 2287 2298 if(postRequest!=NULL) 2288 2299 setMapInMaps (m, "renv", "xrequest", postRequest->value); … … 2335 2346 return -1; 2336 2347 } 2348 map* testMap=getMapFromMaps(m,"main","memory"); 2349 if(testMap!=NULL && strcasecmp(testMap->value,"load")!=0) 2350 dumpMapsValuesToFiles(&m,&request_input_real_format); 2337 2351 loadServiceAndRun (&m, s1, request_inputs, &request_input_real_format, 2338 2352 &request_output_real_format, &eres); … … 2379 2393 else if (pid == 0) 2380 2394 { 2395 eres = SERVICE_ACCEPTED; 2381 2396 // 2382 2397 // son : have to close the stdout, stdin and stderr to let the parent … … 2457 2472 recordServiceStatus(m); 2458 2473 #endif 2474 #ifdef USE_HPC 2459 2475 invokeCallback(m,NULL,NULL,0,0); 2476 #endif 2460 2477 if(vid==0){ 2461 2478 // … … 2499 2516 free(flenv); 2500 2517 2518 #ifdef USE_HPC 2501 2519 invokeCallback(m,request_input_real_format,NULL,1,0); 2520 #endif 2502 2521 if(validateRequest(&m,s1,request_inputs, &request_input_real_format,&request_output_real_format,&hInternet)<0){ 2503 2522 freeService (&s1); … … 2514 2533 #else 2515 2534 recordResponse(m,fbkp1); 2535 #ifdef USE_HPC 2516 2536 invokeCallback(m,NULL,NULL,7,0); 2537 #endif 2517 2538 #endif 2518 2539 unlink (fbkpid); … … 2539 2560 if(getMapFromMaps(m,"lenv","mapError")!=NULL){ 2540 2561 setMapInMaps(m,"lenv","message",_("Issue with geographic data")); 2562 #ifdef USE_HPC 2541 2563 invokeCallback(m,NULL,NULL,7,0); 2564 #endif 2542 2565 eres=-1;//SERVICE_FAILED; 2543 2566 }else{ 2567 map* testMap=getMapFromMaps(m,"main","memory"); 2568 if(testMap!=NULL && strcasecmp(testMap->value,"load")!=0) 2569 dumpMapsValuesToFiles(&m,&request_input_real_format); 2544 2570 loadServiceAndRun (&m, s1, request_inputs, 2545 2571 &request_input_real_format, … … 2567 2593 rewind(stdout); 2568 2594 2569 fprintf(stderr,"%s %d %d\n",__FILE__,__LINE__,eres);2595 //fprintf(stderr,"%s %d %d\n",__FILE__,__LINE__,eres); 2570 2596 2571 2597 if (eres != -1) … … 2592 2618 { 2593 2619 if (eres == SERVICE_SUCCEEDED) 2620 #ifdef USE_HPC 2594 2621 invokeCallback(m,NULL,request_output_real_format,5,1); 2595 2622 #endif 2596 2623 fflush(stderr); 2597 2624 fflush(stdout); … … 2622 2649 recordResponse(m,fbkp1); 2623 2650 if (eres == SERVICE_SUCCEEDED) 2651 #ifdef USE_HPC 2624 2652 invokeCallback(m,NULL,request_output_real_format,6,0); 2653 #endif 2625 2654 #endif 2626 2655 freeMaps(&bmap);
Note: See TracChangeset
for help on using the changeset viewer.