- Timestamp:
- Dec 23, 2012, 11:50:33 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/thirds/cgic206/cgic.c
r364 r379 23 23 #define CGICDEBUGEND 24 24 #endif /* CGICDEBUG */ 25 26 #ifdef WIN32 27 #define _INC_STDIO 28 #endif 25 29 26 30 #include <stdio.h> -
trunk/thirds/dirent-win32/dirent.h
r348 r379 1 1 #ifndef DIRENT_INCLUDED 2 #define DIRENT_INCLUDED 2 #define DIRENT_INCLUDED 1 3 3 4 4 /* -
trunk/zoo-project/HISTORY.txt
r360 r379 9 9 * Add importScripts function to JavaScript support (ticket #66) 10 10 * Add multiple inputs values for the same identifier (ticket #72) 11 * Add Python ZOO-API to access ZOO-Kernel internel functions 12 * Add a [headers] section in main.cfg file to add specifics to header returned 13 * Add support for multiple outputs 11 14 12 15 Version 1.2.0-rc3 -
trunk/zoo-project/zoo-kernel/service.h
r375 r379 33 33 #ifndef snprintf 34 34 #define snprintf sprintf_s 35 #else 36 35 37 #endif 36 38 #endif … … 49 51 #define true 1 50 52 #define false -1 53 #else 54 //#include <stdbool.h> 51 55 #endif 52 56 … … 614 618 sprintf(tmp,"%s_%d",key,index); 615 619 else 616 sprintf(tmp, key);620 sprintf(tmp,"%s",key); 617 621 #ifdef DEBUG 618 622 fprintf(stderr,"** KEY %s\n",tmp); … … 632 636 sprintf(tmp,"%s_%d",key,index); 633 637 else 634 sprintf(tmp, key);638 sprintf(tmp,"%s",key); 635 639 map* tmpSize=getMapArray(m,"size",index); 636 640 if(tmpSize!=NULL && strncasecmp(key,"value",5)==0){ -
trunk/zoo-project/zoo-kernel/service_conf.y
r226 r379 151 151 : INFCAR ID Attributeetoile SUPCAR 152 152 { 153 #ifdef DEBUG_SERVICE_CONF 154 fprintf(stderr,"(%s %d) %s\n",__FILE__,__LINE__,$2); 155 fflush(stderr); 156 #endif 153 157 if(my_service->content==NULL){ 154 158 #ifdef DEBUG_SERVICE_CONF … … 226 230 #ifdef DEBUG_SERVICE_CONF 227 231 fprintf(stderr,"(DATAOUTPUTS - %d) ALLOCATE current_element (%s)\n",__LINE__,$2); 232 fflush(stderr); 228 233 #endif 229 234 current_element=(elements*)malloc(ELEMENTS_SIZE); … … 272 277 if(wait_metadata==true){ 273 278 if(current_content!=NULL){ 279 #ifdef DEBUG_SERVICE_CONF 280 fprintf(stderr,"add current_content to current_element->content\n"); 281 fprintf(stderr,"LINE %d",__LINE__); 282 #endif 274 283 addMapToMap(¤t_element->metadata,current_content); 275 284 current_element->next=NULL; … … 290 299 current_element->next=NULL; 291 300 if($2!=NULL) 292 current_element->format=strdup($2);301 current_element->format=strdup($2); 293 302 current_element->defaults=NULL; 294 303 current_element->supported=NULL; … … 312 321 #ifdef DEBUG_SERVICE_CONF 313 322 printf("* Identifiant : %s\n",$2); 323 fflush(stdout); 314 324 #endif 315 325 } … … 357 367 EmptyElemTag 358 368 : INFCAR ID Attributeetoile SLASH SUPCAR { 369 #ifdef DEBUG_SERVICE_CONF 370 fprintf(stderr,"(%s %d)\n",__FILE__,__LINE__); 371 #endif 359 372 if(strncasecmp($2,"Default",7)==0){ 360 373 wait_defaults=false; … … 386 399 : INFCAR SLASH ID SUPCAR 387 400 { 401 #ifdef DEBUG_SERVICE_CONF 402 fprintf(stderr,"(%s %d)\n",__FILE__,__LINE__); 403 #endif 388 404 if(strcmp($3,"DataInputs")==0){ 389 405 current_data=1; … … 495 511 | EPAIR { 496 512 #ifdef DEBUG_SERVICE_CONF 513 fprintf(stderr,"(%s %d)\n",__FILE__,__LINE__); 497 514 fprintf(stderr,"EPAIR FOUND !! \n"); 498 515 fprintf(stderr,"[%s=>%s]\n",curr_key,$1); … … 510 527 fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key); 511 528 #endif 512 //current_content->next=NULL;513 529 } 514 530 else{ … … 524 540 } 525 541 #ifdef DEBUG_SERVICE_CONF 526 fprintf(stderr,"EPAIR FOUND !! \n");527 542 fprintf(stderr,"[%s=>%s]\n",curr_key,$1); 528 543 fprintf(stderr,"[ZOO: service_conf.y line %d free(%s)]\n",__LINE__,curr_key); 544 dumpMap(current_content); 529 545 fflush(stderr); 530 546 #endif … … 540 556 processid 541 557 : ANID { 558 #ifdef DEBUG_SERVICE_CONF 559 fprintf(stderr,"(%s %d)\n",__FILE__,__LINE__); 560 #endif 542 561 if(data==-1){ 543 562 data=1; … … 690 709 free(current_element); 691 710 current_element=NULL; 711 current_element=(elements*)malloc(ELEMENTS_SIZE); 712 char *cen=strdup($1); 713 current_element->name=(char*)malloc((strlen(cen)-1)*sizeof(char)); 714 cen[strlen(cen)-1]=0; 715 cen+=1; 716 sprintf(current_element->name,"%s",cen); 717 cen-=1; 718 free(cen); 719 current_element->content=NULL; 720 current_element->metadata=NULL; 721 current_element->format=NULL; 722 current_element->defaults=NULL; 723 current_element->supported=NULL; 724 current_element->next=NULL; 692 725 } 693 726 else{ 694 727 #ifdef DEBUG_SERVICE_CONF 695 728 fprintf(stderr,"NAME OUT %s\n",$1); 696 fprintf(stderr,"(DATAOUTPUTS - 545) SET NAME OF current_element\n");729 fprintf(stderr,"(DATAOUTPUTS - %d) SET NAME OF current_element %s\n",__LINE__,$1); 697 730 #endif 698 731 if($1!=NULL){ 699 732 char *cen=strdup($1); 700 current_element->name=(char*)malloc((strlen(cen) -1)*sizeof(char*));733 current_element->name=(char*)malloc((strlen(cen))*sizeof(char*)); 701 734 cen[strlen(cen)-1]=0; 702 735 #ifdef DEBUG -
trunk/zoo-project/zoo-kernel/service_internal.c
r378 r379 1347 1347 maps* mcursor=outputs; 1348 1348 elements* scursor=serv->outputs; 1349 map* testResponse=getMap(request,"RawDataOutput"); 1350 if(testResponse==NULL) 1351 testResponse=getMap(request,"ResponseDocument"); 1349 1352 while(mcursor!=NULL){ 1353 map* tmp0=getMap(mcursor->content,"inRequest"); 1350 1354 scursor=getElements(serv->outputs,mcursor->name); 1351 1355 if(scursor!=NULL){ 1352 printIOType(doc,nc,ns,ns_ows,ns_xlink,scursor,mcursor,"Output"); 1356 if(testResponse==NULL) 1357 printIOType(doc,nc,ns,ns_ows,ns_xlink,scursor,mcursor,"Output"); 1358 else 1359 if(strncmp(tmp0->value,"true",4)==0) 1360 printIOType(doc,nc,ns,ns_ows,ns_xlink,scursor,mcursor,"Output"); 1353 1361 } 1354 1362 mcursor=mcursor->next; … … 1599 1607 map* tmp1=getMap(m->content,"encoding"); 1600 1608 map* tmp2=getMap(m->content,"mimeType"); 1601 map* toto=getMap(m->content,"value"); 1609 map* tmp3=getMap(m->content,"value"); 1610 int hasValue=1; 1611 if(tmp3==NULL){ 1612 tmp3=createMap("value",""); 1613 hasValue=-1; 1614 } 1602 1615 if((tmp1!=NULL && strncmp(tmp1->value,"base64",6)==0) 1603 1616 || (tmp2!=NULL && (strncmp(tmp2->value,"image/",6)==0 || … … 1610 1623 if(rs==NULL){ 1611 1624 char tmp1[1024]; 1612 sprintf(tmp1,"%d",strlen(t oto->value));1625 sprintf(tmp1,"%d",strlen(tmp3->value)); 1613 1626 rs=createMap("size",tmp1); 1614 1627 isSized=false; 1615 1628 } 1616 1629 1617 xmlAddChild(nc3,xmlNewText(BAD_CAST base64(t oto->value, atoi(rs->value))));1630 xmlAddChild(nc3,xmlNewText(BAD_CAST base64(tmp3->value, atoi(rs->value)))); 1618 1631 if(!isSized){ 1619 1632 freeMap(&rs); … … 1624 1637 if(strncmp(tmp2->value,"text/js",7)==0 || 1625 1638 strncmp(tmp2->value,"application/json",16)==0) 1626 xmlAddChild(nc3,xmlNewCDataBlock(doc,BAD_CAST t oto->value,strlen(toto->value)));1639 xmlAddChild(nc3,xmlNewCDataBlock(doc,BAD_CAST tmp3->value,strlen(tmp3->value))); 1627 1640 else{ 1628 1641 if(strncmp(tmp2->value,"text/xml",8)==0 || 1629 1642 strncmp(tmp2->value,"application/vnd.google-earth.kml",32)==0){ 1630 1643 xmlDocPtr doc = 1631 xmlParseMemory(t oto->value,strlen(toto->value));1644 xmlParseMemory(tmp3->value,strlen(tmp3->value)); 1632 1645 xmlNodePtr ir = xmlDocGetRootElement(doc); 1633 1646 xmlAddChild(nc3,ir); 1634 1647 } 1635 1648 else 1636 xmlAddChild(nc3,xmlNewText(BAD_CAST t oto->value));1649 xmlAddChild(nc3,xmlNewText(BAD_CAST tmp3->value)); 1637 1650 } 1638 1651 xmlAddChild(nc2,nc3); 1639 1652 } 1640 1653 else{ 1641 xmlAddChild(nc3,xmlNewText(BAD_CAST toto->value)); 1642 } 1654 xmlAddChild(nc3,xmlNewText(BAD_CAST tmp3->value)); 1655 } 1656 if(hasValue<0){ 1657 freeMap(&tmp3); 1658 free(tmp3); 1659 } 1643 1660 } 1644 1661 } … … 1811 1828 asRaw=1; 1812 1829 1813 map *_tmp=getMapFromMaps(m,"lenv","cookie"); 1814 map *_tmp1=getMapFromMaps(m,"lenv","sessid"); 1815 if(_tmp!=NULL){ 1816 printf("Set-Cookie: %s\r\n",_tmp->value); 1817 printf("P3P: CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"\r\n"); 1818 maps *tmpSess=getMaps(m,"senv"); 1819 if(tmpSess!=NULL){ 1820 char session_file_path[1024]; 1821 map *tmpPath=getMapFromMaps(m,"main","sessPath"); 1822 if(tmpPath==NULL) 1823 tmpPath=getMapFromMaps(m,"main","tmpPath"); 1830 maps* tmpSess=getMaps(m,"senv"); 1831 if(tmpSess!=NULL){ 1832 map *_tmp=getMapFromMaps(m,"lenv","cookie"); 1833 char* sessId; 1834 if(_tmp!=NULL){ 1835 printf("Set-Cookie: %s\r\n",_tmp->value); 1836 printf("P3P: CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"\r\n"); 1837 char session_file_path[100]; 1824 1838 char *tmp1=strtok(_tmp->value,";"); 1825 1839 if(tmp1!=NULL) 1826 sprintf(session_file_path,"%s /sess_%s.cfg",tmpPath->value,strstr(tmp1,"=")+1);1840 sprintf(session_file_path,"%s",strstr(tmp1,"=")+1); 1827 1841 else 1828 sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,strstr(_tmp->value,"=")+1); 1829 dumpMapsToFile(tmpSess,session_file_path); 1830 } 1831 } 1832 1842 sprintf(session_file_path,"%s",strstr(_tmp->value,"=")+1); 1843 sessId=strdup(session_file_path); 1844 }else{ 1845 maps* t=getMaps(m,"senv"); 1846 map*p=t->content; 1847 while(p!=NULL){ 1848 if(strstr(p->name,"ID")!=NULL){ 1849 sessId=strdup(p->value); 1850 break; 1851 } 1852 p=p->next; 1853 } 1854 } 1855 char session_file_path[1024]; 1856 map *tmpPath=getMapFromMaps(m,"main","sessPath"); 1857 if(tmpPath==NULL) 1858 tmpPath=getMapFromMaps(m,"main","tmpPath"); 1859 sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,sessId); 1860 dumpMapsToFile(tmpSess,session_file_path); 1861 } 1862 1833 1863 printHeaders(m); 1834 1864 … … 2472 2502 fprintf(stderr,"MD5STR : (%s)\n\n",md5str); 2473 2503 #endif 2474 char* fname=(char*)malloc(sizeof(char)*(strlen(tmpM->value)+ 38));2504 char* fname=(char*)malloc(sizeof(char)*(strlen(tmpM->value)+50)); 2475 2505 sprintf(fname,"%s/%s.zca",tmpM->value,md5str); 2476 2506 struct stat f_status; … … 2495 2525 char* cached=isInCache(m,url); 2496 2526 int fsize; 2527 int hasF=-1; 2497 2528 if(cached!=NULL){ 2498 2529 struct stat f_status; 2499 2530 int s=stat(cached, &f_status); 2500 2531 if(s==0){ 2501 fprintf(stderr,"FILE SIZE (%d)\n",f_status.st_size/1024);2502 2532 fcontent=(char*)malloc(sizeof(char)*(f_status.st_size+1)); 2503 2533 FILE* f=fopen(cached,"rb"); 2504 2534 fread(fcontent,sizeof(char),f_status.st_size,f); 2505 2535 fsize=f_status.st_size; 2536 hasF=1; 2506 2537 } 2507 2538 }else{ 2508 2539 res=InternetOpenUrl(hInternet,url,NULL,0,INTERNET_FLAG_NO_CACHE_WRITE,0); 2509 fcontent=(char*) calloc((res.nDataLen+1),sizeof(char));2540 fcontent=(char*)malloc((res.nDataLen+1)*sizeof(char)); 2510 2541 if(fcontent == NULL){ 2511 2542 return errorException(m, _("Unable to allocate memory."), "InternalError"); 2512 2543 } 2544 hasF=1; 2513 2545 size_t dwRead; 2514 2546 InternetReadFile(res, (LPVOID)fcontent, res.nDataLen, &dwRead); … … 2524 2556 free(tmpMap->value); 2525 2557 tmpMap->value=(char*)malloc((fsize+1)*sizeof(char)); 2558 if(tmpMap->value==NULL) 2559 fprintf(stderr,"Unable to allocate memory!\n"); 2526 2560 memcpy(tmpMap->value,fcontent,(fsize)*sizeof(char)); 2527 2561 2528 2562 char ltmp1[256]; 2529 2563 sprintf(ltmp1,"%d",fsize); … … 2531 2565 if(cached==NULL) 2532 2566 addToCache(m,url,fcontent,fsize); 2533 free(fcontent); 2534 if(cached!=NULL) 2567 else{ 2568 if(hasF) 2569 free(fcontent); 2535 2570 free(cached); 2571 } 2536 2572 return 0; 2537 2573 } -
trunk/zoo-project/zoo-kernel/service_internal_ms.c
r370 r379 1 /** 2 * Author : Gérald FENOY 3 * 4 * Copyright 2010-2011 Fondazione Edmund Mach. All rights reserved. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights 9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 * copies of the Software, and to permit persons to whom the Software is 11 * furnished to do so, subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be included in 14 * all copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * THE SOFTWARE. 23 */ 24 1 25 #ifdef USE_MS 2 26 #ifndef WIN32 … … 556 580 else 557 581 msInsertHashTable(&(myLayer->metadata), "ows_title", "Default Title"); 558 582 559 583 if(msGrowLayerClasses(myLayer) == NULL) 560 584 return -1; … … 566 590 if(initStyle(myLayer->CLASS[myLayer->numclasses]->styles[myLayer->CLASS[myLayer->numclasses]->numstyles]) == -1) 567 591 return -1; 568 569 592 /** 570 593 * Apply msStyle else fallback to the default style … … 583 606 myLayer->CLASS[myLayer->numclasses]->styles[myLayer->CLASS[myLayer->numclasses]->numstyles]->outlinecolor.green=80; 584 607 myLayer->CLASS[myLayer->numclasses]->styles[myLayer->CLASS[myLayer->numclasses]->numstyles]->outlinecolor.blue=80; 585 608 586 609 /** 587 610 * Set specific style depending on type … … 597 620 myLayer->CLASS[myLayer->numclasses]->styles[myLayer->CLASS[myLayer->numclasses]->numstyles]->size=15; 598 621 } 599 622 600 623 } 601 624 myLayer->CLASS[myLayer->numclasses]->numstyles++; 602 625 myLayer->numclasses++; 626 603 627 m->layerorder[m->numlayers] = m->numlayers; 604 628 m->numlayers++; -
trunk/zoo-project/zoo-kernel/service_internal_ms.h
r364 r379 1 /** 2 * Author : Gérald FENOY 3 * 4 * Copyright 2010 Fondazione Edmund Mach. All rights reserved. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights 9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 * copies of the Software, and to permit persons to whom the Software is 11 * furnished to do so, subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be included in 14 * all copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 * THE SOFTWARE. 23 */ 1 24 #ifndef ZOO_SERVICE_INTERNAL_MS_H 2 25 #define ZOO_SERVICE_INTERNAL_MS_H 1 -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r376 r379 775 775 memset(buff1,0,1024); 776 776 #ifdef DEBUG 777 fprintf(stderr,"\n#######%s\n########\n",buff1);777 printf("\n#######%s\n########\n",buff1); 778 778 #endif 779 779 while ((dp = readdir(dirp)) != NULL) … … 784 784 s1=(service*)calloc(1,SERVICE_SIZE); 785 785 if(s1 == NULL){ 786 dup2(saved_stdout,fileno(stdout)); 786 787 return errorException(m, _("Unable to allocate memory."),"InternalError"); 787 788 } 788 789 #ifdef DEBUG 789 fprintf(stderr,"#################\n%s\n#################\n",buff1);790 printf("#################\n%s\n#################\n",buff1); 790 791 #endif 791 792 t=getServiceFromFile(buff1,&s1); … … 1325 1326 if(!(ltmp!=NULL && strcmp(ltmp->value,"POST")==0) 1326 1327 && CHECK_INET_HANDLE(hInternet)){ 1327 if(loadRemoteFile(m,tmpmaps->content,hInternet,(char*)val) ){1328 if(loadRemoteFile(m,tmpmaps->content,hInternet,(char*)val)!=0){ 1328 1329 freeMaps(&m); 1329 1330 free(m);
Note: See TracChangeset
for help on using the changeset viewer.