- Timestamp:
- Mar 19, 2015, 10:01:11 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PublicaMundi_David-devel/zoo-project/zoo-kernel/zoo_service_loader.c
r604 r617 31 31 #include "zoo_amqp.h" 32 32 #include "zoo_sql.h" 33 #include "zoo_json.h" 33 34 extern "C" 34 35 { … … 275 276 } 276 277 277 #include "zoo_json.h"278 278 void 279 279 loadServiceAndRun (maps ** myMap, service * s1, map * request_inputs, … … 281 281 { 282 282 283 json_object *obj;284 mapstojson(&obj,*myMap);285 fprintf(stderr,"myMaps: %s\n",json_object_to_json_string(obj));286 287 288 json_object *obj3;289 mapstojson(&obj3,*inputs);290 fprintf(stderr,"inputs: %s\n",json_object_to_json_string(obj3));291 292 293 json_object *obj1;294 maptojson(&obj1,request_inputs);295 fprintf(stderr,"request_inputs: %s\n",json_object_to_json_string(obj1));296 297 json_object *obj2;298 mapstojson(&obj2,*ioutputs);299 fprintf(stderr,"ioutputs: %s\n",json_object_to_json_string(obj2));300 301 302 303 fflush(stderr);304 305 283 306 284 char tmps1[1024]; … … 309 287 maps *request_output_real_format = *ioutputs; 310 288 maps *request_input_real_format = *inputs; 289 map * background = NULL; 290 map * uuid = getMapFromMaps(m,"lenv","usid"); 291 background = getMapFromMaps(m,"lenv","background"); 292 293 311 294 /** 312 295 * Extract serviceType to know what kind of service should be loaded … … 443 426 ("Error occured while running the %s function: %s"), 444 427 s1->name, errstr); 445 errorException (m, tmpMsg, "InternalError", NULL,out); 428 429 if (background == NULL){ 430 errorException (m, tmpMsg, "InternalError", NULL,out); 431 } 432 else { 433 /* mise a jour de la table status */ 434 } 446 435 free (tmpMsg); 447 436 #ifdef DEBUG … … 466 455 fflush (stderr); 467 456 #endif 468 *eres = 457 458 *eres = 469 459 execute (&m, &request_input_real_format, 470 460 &request_output_real_format); 471 461 #ifdef DEBUG 472 fprintf (stderr, "Function loaded and returned %d\n", eres);462 fprintf (stderr, "Function loaded and returned %d\n", *eres); 473 463 fflush (stderr); 474 464 #endif … … 497 487 sprintf (tmps, _("C Library can't be loaded %s"), errstr); 498 488 map *tmps1 = createMap ("text", tmps); 499 printExceptionReportResponse (m, tmps1,out); 489 if (background == NULL){ 490 printExceptionReportResponse (m, tmps1,out); 491 } 492 else { 493 /* mise a jour table status */ 494 } 500 495 *eres = -1; 501 496 freeMap (&tmps1); … … 578 573 ("Programming Language (%s) set in ZCFG file is not currently supported by ZOO Kernel.\n"), 579 574 r_inputs->value); 580 map *tmps = createMap ("text", tmpv); 581 printExceptionReportResponse (m, tmps,out); 575 if (background == NULL){ 576 map *tmps = createMap ("text", tmpv); 577 printExceptionReportResponse (m, tmps,out); 578 } 579 else { 580 /* mise jour table status */ 581 } 582 582 *eres = -1; 583 583 } … … 3043 3043 if (status == NULLMAP) 3044 3044 { 3045 3045 3046 loadServiceAndRun 3046 3047 (&m, s1, … … 3055 3056 3056 3057 eres = SERVICE_ACCEPTED; 3057 json_object * msg_jobj = json_object_new_object(); 3058 json_object_object_add(msg_jobj,"service_identifier",json_object_new_string(service_identifier)); 3059 3060 3058 json_object *msg_jobj = json_object_new_object(); 3061 3059 json_object *maps_obj; 3062 3060 mapstojson(&maps_obj,m); … … 3076 3074 mapstojson(&outputs_jobj,request_output_real_format); 3077 3075 json_object_object_add(msg_jobj,"request_output_real_format",outputs_jobj); 3078 3079 if ( (send_msg(json_object_to_json_string(msg_jobj),"application/json") != 0) || (add_status(uuid) != 0) ){ 3076 3077 bind_amqp(); 3078 3079 if ( (send_msg(json_object_to_json_string(msg_jobj),"application/json") != 0) || (add_job(uuid) != 0) ){ 3080 3080 eres = SERVICE_FAILED; 3081 3081 } 3082 close_amqp(); 3083 json_object_put(msg_jobj); 3084 3082 3085 3083 3086 }
Note: See TracChangeset
for help on using the changeset viewer.