- Timestamp:
- Dec 12, 2015, 5:39:48 PM (9 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/Makefile.in
r735 r745 94 94 95 95 libzoo_service.${EXT}: version.h service_internal.o service.o sqlapi.o 96 gcc -shared ${GDAL_CFLAGS} ${DEFAULT_OPTS} -fpic -o libzoo_service.${EXT} ${CFLAGS} service_internal.o service.o sqlapi.o -lfcgi${GDAL_LIBS}96 gcc -shared ${GDAL_CFLAGS} ${DEFAULT_OPTS} -fpic -o libzoo_service.${EXT} ${CFLAGS} service_internal.o service.o sqlapi.o ${FCGI_LDFLAGS} ${GDAL_LIBS} 97 97 98 98 zoo_loader.cgi: version.h libzoo_service.${EXT} zoo_loader.c zoo_service_loader.o ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o request_parser.o response_print.o server_internal.o caching.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} -
trunk/zoo-project/zoo-kernel/request_parser.c
r725 r745 483 483 484 484 /** 485 * Create a "missingIdentifier" maps in case it is NULL. 486 * 487 * @param main_conf the conf maps containing the main.cfg settings 488 * @param mymaps the maps to update 489 * @return 0 on success, 4 on failure 490 */ 491 int defineMissingIdentifier(maps** main_conf,maps** mymaps){ 492 if (*mymaps == NULL){ 493 *mymaps = (maps *) malloc (MAPS_SIZE); 494 if (*mymaps == NULL){ 495 return errorException (*main_conf, 496 _("Unable to allocate memory"), 497 "InternalError", NULL); 498 } 499 (*mymaps)->name = zStrdup ("missingIndetifier"); 500 (*mymaps)->content = NULL; 501 (*mymaps)->next = NULL; 502 } 503 return 0; 504 } 505 506 /** 485 507 * Parse inputs from XML nodes and store them in a maps. 486 508 * … … 528 550 xmlChar *val = 529 551 xmlNodeListGetString (doc, cur2->xmlChildrenNode, 1); 530 if (tmpmaps == NULL )552 if (tmpmaps == NULL && val!=NULL) 531 553 { 532 554 tmpmaps = (maps *) malloc (MAPS_SIZE); … … 541 563 tmpmaps->content = NULL; 542 564 tmpmaps->next = NULL; 565 xmlFree (val); 543 566 } 544 xmlFree (val);545 567 } 546 568 // Title, Asbtract … … 553 575 xmlChar *val = 554 576 xmlNodeListGetString (doc, cur2->xmlChildrenNode, 1); 555 if (tmpmaps == NULL) 556 { 557 tmpmaps = (maps *) malloc (MAPS_SIZE); 558 if (tmpmaps == NULL) 559 { 560 return errorException (*main_conf, 561 _ 562 ("Unable to allocate memory"), 563 "InternalError", NULL); 564 } 565 tmpmaps->name = zStrdup ("missingIndetifier"); 577 defineMissingIdentifier(main_conf,&tmpmaps); 578 if(val!=NULL){ 579 if (tmpmaps->content != NULL) 580 addToMap (tmpmaps->content, 581 (char *) cur2->name, (char *) val); 582 else 566 583 tmpmaps->content = 567 584 createMap ((char *) cur2->name, (char *) val); 568 tmpmaps->next = NULL; 569 } 570 else 571 { 572 if (tmpmaps->content != NULL) 573 addToMap (tmpmaps->content, 574 (char *) cur2->name, (char *) val); 575 else 576 tmpmaps->content = 577 createMap ((char *) cur2->name, (char *) val); 578 } 579 xmlFree (val); 585 xmlFree (val); 586 } 580 587 } 581 588 // InputDataFormChoice (Reference or Data ?) 582 589 if (xmlStrcasecmp (cur2->name, BAD_CAST "Reference") == 0) 583 590 { 591 defineMissingIdentifier(main_conf,&tmpmaps); 584 592 // Get every attribute from a Reference node 585 593 // mimeType, encoding, schema, href, method … … 721 729 722 730 sprintf (tmp, "%s", (char*) btmps); 723 724 xmlFreeDoc (bdoc);731 732 //xmlFreeDoc (bdoc); 725 733 726 734 map *btmp = … … 815 823 else if (xmlStrcasecmp (cur2->name, BAD_CAST "Data") == 0) 816 824 { 825 defineMissingIdentifier(main_conf,&tmpmaps); 817 826 xmlNodePtr cur4 = cur2->children; 818 827 if(vid==1){ … … 946 955 && cur5->type != XML_CDATA_SECTION_NODE) 947 956 cur5 = cur5->next; 957 fprintf(stderr,"%s %d\n",__FILE__,__LINE__); 958 fflush(stderr); 948 959 if (cur5 != NULL 949 960 && cur5->type != XML_CDATA_SECTION_NODE) … … 953 964 &buffersize, 954 965 "utf-8", 0); 955 addIntToMap (tmpmaps->content, "size",956 buffersize);957 xmlFreeDoc (doc1);958 966 } 959 967 else … … 961 969 if (cur5 != NULL 962 970 && cur5->type == XML_CDATA_SECTION_NODE){ 963 xmlDocPtr doc2 = xml ParseMemory((const char*)cur5->content,xmlStrlen(cur5->content));964 xmlDocSetRootElement (doc1,xmlDocGetRootElement(doc2));965 xmlDocDumpFormatMemoryEnc (doc 1, &mv,971 xmlDocPtr doc2 = xmlReadMemory((const char*)cur5->content,xmlStrlen(cur5->content), 972 "input_content.xml", NULL, XML_PARSE_RECOVER); 973 xmlDocDumpFormatMemoryEnc (doc2, &mv, 966 974 &buffersize, 967 975 "utf-8", 0); 968 addIntToMap(tmpmaps->content, "size",buffersize);969 976 xmlFreeDoc (doc2); 970 xmlFreeDoc (doc1);971 977 } 972 978 } 979 addIntToMap (tmpmaps->content, "size", 980 buffersize); 981 xmlFreeDoc (doc1); 973 982 }else{ 974 983 xmlNodePtr cur5 = cur4->children; … … 1008 1017 } 1009 1018 { 1019 map* test=getMap(tmpmaps->content,"value"); 1020 if(test==NULL) 1021 addToMap(tmpmaps->content,"value",""); 1010 1022 maps *testPresence = 1011 1023 getMaps (*request_output, tmpmaps->name); … … 1324 1336 1325 1337 xmlInitParser (); 1326 xmlDocPtr doc = xml ParseMemory (post, cgiContentLength);1338 xmlDocPtr doc = xmlReadMemory (post, cgiContentLength, "input_request.xml", NULL, XML_PARSE_RECOVER); 1327 1339 1328 1340 /** -
trunk/zoo-project/zoo-kernel/service_yaml.c
r580 r745 46 46 */ 47 47 int getServiceFromYAML(maps* conf, char* file,service** service,char *name){ 48 FILE *fh = fopen("test.yml", "r");48 FILE *fh; 49 49 if(current_content!=NULL){ 50 50 freeMap(¤t_content); -
trunk/zoo-project/zoo-kernel/zoo_loader.c
r718 r745 216 216 addToMap(tmpMap,"xrequest",t1->value); 217 217 xmlInitParser(); 218 xmlDocPtr doc = xml ParseMemory(t1->value,cgiContentLength);218 xmlDocPtr doc = xmlReadMemory(t1->value, cgiContentLength, "input_request.xml", NULL, XML_PARSE_RECOVER); 219 219 { 220 220 xmlXPathObjectPtr reqptr=extractFromDoc(doc,"/*[local-name()='Envelope']/*[local-name()='Body']/*"); -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r738 r745 961 961 setenv ("LC_ALL", tmp, 1); 962 962 #else 963 963 char tmp1[13]; 964 964 sprintf (tmp1, "LC_ALL=%s", tmp); 965 965 putenv (tmp1); … … 973 973 setenv ("LC_ALL", "en_US", 1); 974 974 #else 975 975 char tmp1[13]; 976 976 sprintf (tmp1, "LC_ALL=en_US"); 977 977 putenv (tmp1); … … 979 979 setMapInMaps (m, "main", "language", "en-US"); 980 980 } 981 setlocale (LC_NUMERIC, "en_US"); 981 setlocale (LC_NUMERIC, "C"); 982 #ifndef WIN32 983 setenv ("LC_NUMERIC", "C", 1); 984 #else 985 char tmp1[17]; 986 sprintf (tmp1, "LC_NUMERIC=C"); 987 putenv (tmp1); 988 #endif 982 989 bind_textdomain_codeset ("zoo-kernel", "UTF-8"); 983 990 textdomain ("zoo-kernel");
Note: See TracChangeset
for help on using the changeset viewer.