Changeset 897
- Timestamp:
- Mar 21, 2019, 4:14:14 PM (6 years ago)
- Location:
- branches/prototype-v0/zoo-project/zoo-kernel
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/makefile.vc
r892 r897 74 74 $(CPP) /c $(CFLAGS) service_internal_ruby.c 75 75 76 service_internal_mono.obj: service_internal_mono.c service_internal_mono.h service.h 77 $(CPP) /c $(MONO_CLAGS) $(CFLAGS) service_internal_mono.c 78 76 79 service_internal_python.obj: service_internal_python.c service.h 77 80 $(CPP) /c $(CFLAGS) service_internal_python.c … … 101 104 link /dll /out:$(LIBZOO_SERVICE) ./service.obj ./service_internal.obj ./sqlapi.obj $(LDFLAGS) /FORCE:MULTIPLE 102 105 103 $(PROGRAMNAME): version.h $(LIBZOO_SERVICE) zoo_loader.obj zoo_service_loader.obj service_internal.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $( RUBY_FILE) $(PHP_FILE) ulinet.obj lex.cr.obj lex.sr.obj service_conf.tab.obj main_conf_read.tab.obj request_parser.obj response_print.obj server_internal.obj caching.obj service_json.obj service_callback.obj104 link zoo_loader.obj request_parser.obj response_print.obj server_internal.obj caching.obj service_json.obj service_callback.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $( RUBY_FILE) $(PHP_FILE) ulinet.obj main_conf_read.tab.obj lex.cr.obj service_conf.tab.obj lex.sr.obj zoo_service_loader.obj ./libzoo_service.lib /out:$(PROGRAMNAME) $(LDFLAGS) $(LDFLAGSCGI) ..\..\thirds\sdk\release-1800-x64/lib/json-c.lib ..\..\thirds\sdk\release-1800-x64/lib/pthread_dll.lib ..\..\thirds\sdk\release-1800-x64/lib/libxslt.lib106 $(PROGRAMNAME): version.h $(LIBZOO_SERVICE) zoo_loader.obj zoo_service_loader.obj service_internal.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $(MONO_FILE) $(RUBY_FILE) $(PHP_FILE) ulinet.obj lex.cr.obj lex.sr.obj service_conf.tab.obj main_conf_read.tab.obj request_parser.obj response_print.obj server_internal.obj caching.obj service_json.obj service_callback.obj 107 link zoo_loader.obj request_parser.obj response_print.obj server_internal.obj caching.obj service_json.obj service_callback.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $(MONO_FILE) $(RUBY_FILE) $(PHP_FILE) ulinet.obj main_conf_read.tab.obj lex.cr.obj service_conf.tab.obj lex.sr.obj zoo_service_loader.obj ./libzoo_service.lib /out:$(PROGRAMNAME) $(LDFLAGS) $(LDFLAGSCGI) ..\..\thirds\sdk\release-1800-x64/lib/json-c.lib ..\..\thirds\sdk\release-1800-x64/lib/pthread_dll.lib ..\..\thirds\sdk\release-1800-x64/lib/libxslt.lib 105 108 106 zcfg2yaml: version.h zcfg2yaml.obj zoo_service_loader.obj service_internal.obj caching.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $( RUBY_FILE) ulinet.obj lex.cr.obj lex.sr.obj service_conf.tab.obj main_conf_read.tab.obj107 link zcfg2yaml.obj server_internal.obj caching.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $( RUBY_FILE) $(PHP_FILE) ulinet.obj response_print.obj main_conf_read.tab.obj lex.cr.obj service_conf.tab.obj lex.sr.obj ./libzoo_service.lib /out:zcfg2yaml.exe $(LDFLAGS) $(LDFLAGSCGI)109 zcfg2yaml: version.h zcfg2yaml.obj zoo_service_loader.obj service_internal.obj caching.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $(MONO_FILE) $(RUBY_FILE) ulinet.obj lex.cr.obj lex.sr.obj service_conf.tab.obj main_conf_read.tab.obj 110 link zcfg2yaml.obj server_internal.obj caching.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $(MONO_FILE) $(RUBY_FILE) $(PHP_FILE) ulinet.obj response_print.obj main_conf_read.tab.obj lex.cr.obj service_conf.tab.obj lex.sr.obj ./libzoo_service.lib /out:zcfg2yaml.exe $(LDFLAGS) $(LDFLAGSCGI) 108 111 109 112 clean: -
branches/prototype-v0/zoo-project/zoo-kernel/nmake.opt
r788 r897 87 87 !ENDIF 88 88 89 !IFDEF MONO_DIR 90 MONO_CFLAGS=-DUSE_MONO -I"$(MONO_DIR)"\msvc -I"$(MONO_DIR)"\msvc\include -I"$(MONO_DIR)" 91 MONO_LDFLAGS=/LIBPATH:"$(MONO_DIR)/msvc/build/sgen/x64/lib/Release" mono-2.0-sgen.lib 92 MONO_FILE=service_internal_mono.obj 93 !ENDIF 94 89 95 !IFNDEF ZOOK_DIR 90 96 ZOOK_DIR=. -
branches/prototype-v0/zoo-project/zoo-kernel/response_print.c
r896 r897 2871 2871 geodatatype=getMap(tmpI->content,"geodatatype"); 2872 2872 if((nbFeatures!=NULL && atoi(nbFeatures->value)==0) || 2873 (geodatatype!=NULL && strcasecmp(geodatatype->value,"other")==0)) 2873 (geodatatype!=NULL && strcasecmp(geodatatype->value,"other")==0)){ 2874 2874 error=1; 2875 2875 res=SERVICE_FAILED; 2876 } 2876 2877 } 2877 2878 } -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal.c
r896 r897 688 688 } 689 689 } 690 setMapInMaps(conf,"lenv","semaphore","Created"); 690 691 } else if (errno == EEXIST) { /* someone else got it first */ 691 692 int ready = 0; … … 718 719 return -1; 719 720 } 721 setMapInMaps(conf,"lenv","semaphore","Acquired"); 720 722 } else { 721 723 return sem_id; /* error, check errno */ -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_ms.c
r890 r897 403 403 extent=getMapArray(tmpI->content,options[proto][4],imyIndex); 404 404 memset(webService_url,0,strlen(webService_url)); 405 freeMap(&rformat);405 freeMap(&rformat); 406 406 free(rformat); 407 407 rformat=createMap("value","image/tiff"); … … 578 578 579 579 if(test!=NULL){ 580 sprintf(tmpExtent,"%. 3f,%.3f,%.3f,%.3f",min.y,min.x,max.y,max.x);580 sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f",min.y,min.x,max.y,max.x); 581 581 map* isGeo=getMapArray(output->content,"crs_isGeographic",imyIndex); 582 582 #ifdef DEBUGMS … … 584 584 #endif 585 585 if(isGeo!=NULL && strcasecmp("true",isGeo->value)==0){ 586 sprintf(tmpExtent,"%. 3f,%.3f,%.3f,%.3f",min.y,min.x,max.y,max.x);586 sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f",min.y,min.x,max.y,max.x); 587 587 setMapArray(output->content,"wgs84_extent",imyIndex,tmpExtent); 588 sprintf(tmpExtent,"% f,%f,%f,%f", minY,minX, maxY, maxX);588 sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f", minY,minX, maxY, maxX); 589 589 }else{ 590 sprintf(tmpExtent,"%. 3f,%.3f,%.3f,%.3f",min.x,min.y,max.x,max.y);590 sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f",min.x,min.y,max.x,max.y); 591 591 setMapArray(output->content,"wgs84_extent",imyIndex,tmpExtent); 592 592 } 593 593 setMapArray(output->content,"wms_extent",imyIndex,tmpExtent); 594 sprintf(tmpSrsStr,"%. 3f,%.3f,%.3f,%.3f",min.x,min.y,max.x,max.y);594 sprintf(tmpSrsStr,"%.15f,%.15f,%.15f,%.15f",min.x,min.y,max.x,max.y); 595 595 setMapArray(output->content,"wcs_extent",imyIndex,tmpExtent); 596 596 }else{ 597 sprintf(tmpExtent,"%. 3f,%.3f,%.3f,%.3f",min.x,min.y,max.x,max.y);597 sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f",min.x,min.y,max.x,max.y); 598 598 setMapArray(output->content,"wgs84_extent",imyIndex,tmpExtent); 599 sprintf(tmpExtent,"% f,%f,%f,%f",minX, minY, maxX, maxY);599 sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f",minX, minY, maxX, maxY); 600 600 map* isGeo=getMapArray(output->content,"crs_isGeographic",imyIndex); 601 601 if(isGeo!=NULL){ … … 604 604 #endif 605 605 if(isGeo!=NULL && strcasecmp("true",isGeo->value)==0) 606 sprintf(tmpExtent,"% f,%f,%f,%f", minY,minX, maxY, maxX);606 sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f", minY,minX, maxY, maxX); 607 607 } 608 608 setMapArray(output->content,"wms_extent",imyIndex,tmpExtent); 609 sprintf(tmpExtent,"%. 3f,%.3f,%.3f,%.3f",minX,minY,maxX,maxY);609 sprintf(tmpExtent,"%.15f,%.15f,%.15f,%.15f",minX,minY,maxX,maxY); 610 610 setMapArray(output->content,"wcs_extent",imyIndex,tmpExtent); 611 611 } … … 754 754 } 755 755 756 setMapArray(output->content,"gdalType",imyIndex,OGR_Dr_GetName(OGR_DS_GetDriver(poDS))); 756 757 setMapArray(output->content,"geodatatype",imyIndex,"vector"); 757 758 int iLayer = 0; … … 963 964 int imyIndex=getPublishedId(output); 964 965 map* tmpMap=getMapArray(output->content,"storage",imyIndex); 966 map* styleMap=getMap(output->content,"msStyle"); 965 967 char *pszFilename=tmpMap->value; 966 968 GDALDatasetH hDataset; … … 1112 1114 msInsertHashTable(&(myLayer->metadata), "ows_bandcount", nBands); 1113 1115 } 1114 if(nBandsI>=3) 1115 if(nBandsI==4) 1116 msLayerAddProcessing(myLayer,"BANDS=1,2,3,4"); 1116 if(styleMap==NULL || strstr(styleMap->value,"BANDS=")==NULL){ 1117 if(nBandsI>=3) 1118 if(nBandsI==4) 1119 msLayerAddProcessing(myLayer,"BANDS=1,2,3,4"); 1120 else 1121 msLayerAddProcessing(myLayer,"BANDS=1,2,3"); 1122 else if(nBandsI>=2) 1123 msLayerAddProcessing(myLayer,"BANDS=1,2"); 1117 1124 else 1118 msLayerAddProcessing(myLayer,"BANDS=1,2,3"); 1119 else if(nBandsI>=2) 1120 msLayerAddProcessing(myLayer,"BANDS=1,2"); 1121 else 1122 msLayerAddProcessing(myLayer,"BANDS=1"); 1123 1125 msLayerAddProcessing(myLayer,"BANDS=1"); 1126 } 1124 1127 1125 1128 /** … … 1162 1165 char tmpMm[100],tmpMp[100]; 1163 1166 sprintf(tmpMm,"%.3f %.3f",pdfMin,pdfMax); 1164 if(pdfMin!=pdfMax) 1165 sprintf(tmpMp,"SCALE_%d=%.3f,%.3f",iBand+1,pdfMean-(2*pdfStdDev),pdfMean+(2*pdfStdDev)); 1166 /*else 1167 sprintf(tmpMp,"SCALE_%d=%.3f,%.3f",iBand+1,pdfMin,pdfMax);*/ 1167 if(pdfMin!=pdfMax && (styleMap==NULL || strstr(styleMap->value,"SCALE_")==NULL)){ 1168 sprintf(tmpNb,"%d",iBand+1); 1169 if(styleMap==NULL || strstr(styleMap->value,"BANDS=")==NULL || strstr(strstr(styleMap->value,"BANDS="),tmpNb)!=NULL){ 1170 if(pdfMean-(2*pdfStdDev)<0) 1171 sprintf(tmpMp,"SCALE_%d=%.3f,%.3f",iBand+1,0.0,pdfMean+(2*pdfStdDev)); 1172 else 1173 sprintf(tmpMp,"SCALE_%d=%.3f,%.3f",iBand+1,pdfMean-(2*pdfStdDev),pdfMean+(2*pdfStdDev)); 1174 msLayerAddProcessing(myLayer,tmpMp); 1175 } 1176 } 1168 1177 char tmpI[31]; 1169 1178 sprintf(tmpI,"%s_interval",tmpN); 1170 1179 msInsertHashTable(&(myLayer->metadata), tmpI, tmpMm); 1171 //if(pdfMax>255)1172 msLayerAddProcessing(myLayer,tmpMp);1173 1180 map* test=getMap(output->content,"msClassify"); 1174 1181 if(test!=NULL && strncasecmp(test->value,"true",4)==0){ … … 1255 1262 1256 1263 } 1257 msLayerAddProcessing(myLayer,"RESAMPLE=BILINEAR"); 1258 1264 if(styleMap==NULL || strstr(styleMap->value,"RESAMPLE")==NULL) 1265 msLayerAddProcessing(myLayer,"RESAMPLE=BILINEAR"); 1266 1267 if(styleMap!=NULL && strlen(styleMap->value)>9){ 1268 msUpdateLayerFromString(myLayer,styleMap->value,MS_FALSE); 1269 } 1270 1259 1271 m->layerorder[m->numlayers] = m->numlayers; 1260 1272 m->numlayers++; … … 1278 1290 int imyIndex=getPublishedId(outputs); 1279 1291 map* mime=getMapArray(outputs->content,"mimeType",imyIndex); 1292 map* msUrl=getMapFromMaps(conf,"main","mapserverAddress"); 1293 map* dataPath=getMapFromMaps(conf,"main","dataPath"); 1280 1294 char *ext="data"; 1281 1295 if(mime!=NULL) … … 1482 1496 free(correspondance); 1483 1497 1498 map* sid=getMapFromMaps(conf,"lenv","usid"); 1499 char *mapPath= 1500 (char*)malloc((14+strlen(sid->value)+strlen(outputs->name)+strlen(dataPath->value))*sizeof(char)); 1501 sprintf(mapPath,"%s/%s_%d_%s.map",dataPath->value,outputs->name,imyIndex,sid->value); 1502 char *mapUrl= 1503 (char*)malloc((6+strlen(mapPath)+strlen(msUrl->value))*sizeof(char)); 1504 sprintf(mapUrl,"%s?map=%s",msUrl->value,mapPath); 1505 1506 if (msInsertHashTable(&(myMap->web.metadata), "ows_onlineresource", mapUrl) == NULL){ 1507 #ifdef DEBUGMS 1508 fprintf(stderr,"Unable to add metadata"); 1509 #endif 1510 return; 1511 } 1484 1512 1485 1513 if(tryOgr(conf,outputs,myMap)<0) … … 1487 1515 return ; 1488 1516 1489 tmp1=getMapFromMaps(conf,"main","dataPath"); 1490 char *tmpPath=(char*)malloc((13+strlen(tmp1->value))*sizeof(char)); 1491 sprintf(tmpPath,"%s/symbols.sym",tmp1->value); 1517 char *tmpPath=(char*)malloc((13+strlen(dataPath->value))*sizeof(char)); 1518 sprintf(tmpPath,"%s/symbols.sym",dataPath->value); 1492 1519 msInitSymbolSet(&myMap->symbolset); 1493 1520 myMap->symbolset.filename=zStrdup(tmpPath); 1494 1521 free(tmpPath); 1495 1522 1496 map* sid=getMapFromMaps(conf,"lenv","usid");1497 char *mapPath=1498 (char*)malloc((14+strlen(sid->value)+strlen(outputs->name)+strlen(tmp1->value))*sizeof(char));1499 sprintf(mapPath,"%s/%s_%d_%s.map",tmp1->value,outputs->name,imyIndex,sid->value);1500 1523 msSaveMap(myMap,mapPath); 1501 1524 saveMapNames(conf,outputs,mapPath); -
branches/prototype-v0/zoo-project/zoo-kernel/sshapi.c
r890 r897 3 3 * Author : Gérald FENOY 4 4 * 5 * Copyright 2017 GeoLabs SARL. All rights reserved.5 * Copyright 2017-2019 GeoLabs SARL. All rights reserved. 6 6 * 7 7 * This work was supported by public funds received in the framework of GEOSUD, … … 322 322 */ 323 323 bool ssh_copy(maps* conf,const char* localPath,const char* targetPath,int cnt){ 324 char mem[1024 * 1 000];324 char mem[1024 * 16]; 325 325 size_t nread; 326 326 size_t memuse=0; 327 327 time_t start; 328 328 long total = 0; 329 int counter=0; 329 330 int duration; 330 331 int rc; … … 391 392 break; 392 393 393 if(memuse - rc) { 394 memmove(&mem[0], &mem[rc], memuse - rc); 395 memuse -= rc; 396 } 397 else 398 memuse = 0; 394 memuse = 0; 399 395 400 396 } while (rc > 0); … … 438 434 } 439 435 if(!sessions[cnt]->sftp_session) 440 zSleep(1 );436 zSleep(10); 441 437 } while (!sessions[cnt]->sftp_session); 442 438 do { … … 453 449 } 454 450 if(!sftp_handle) 455 zSleep(1 );451 zSleep(10); 456 452 } while (!sftp_handle); 457 453 458 454 int result=0; 455 int counter=0; 459 456 do { 460 457 do { 461 char* mem=(char*)malloc(16*1024 *1024);462 rc = libssh2_sftp_read(sftp_handle, mem,16*1024 *1024);458 char* mem=(char*)malloc(16*1024); 459 rc = libssh2_sftp_read(sftp_handle, mem,16*1024); 463 460 if(rc > 0) { 464 461 fwrite(mem, rc, 1, local); 465 462 } 466 463 free(mem); 464 if(counter%25==0) 465 zSleep(10); 467 466 } while (rc > 0); 468 467 469 468 if(rc != LIBSSH2_ERROR_EAGAIN) { 470 469 result=-1; 471 470 break; 472 471 } 473 472 474 473 struct timeval timeout; 475 474 fd_set fd; 476 475 timeout.tv_sec = 10; 477 476 timeout.tv_usec = 0; 478 477 479 478 FD_ZERO(&fd); 480 479 481 480 FD_SET(sessions[cnt]->sock_id, &fd); 482 481 483 482 rc = select(sessions[cnt]->sock_id+1, &fd, &fd, NULL, &timeout); 484 483 if(rc <= 0) { … … 489 488 return -1; 490 489 } 491 490 491 if(counter%50==0) 492 zSleep(10); 493 counter++; 494 492 495 } while (1); 493 496 duration = (int)(time(NULL)-start); -
branches/prototype-v0/zoo-project/zoo-kernel/ulinet.c
r896 r897 504 504 #endif 505 505 506 if(memUse ==NULL ||strcasecmp(memUse->value,"load")==0)506 if(memUse!=NULL && strcasecmp(memUse->value,"load")==0) 507 507 ldwFlags=INTERNET_FLAG_NO_CACHE_WRITE; 508 508 -
branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c
r896 r897 1307 1307 registry* zooRegistry=NULL; 1308 1308 if(reg!=NULL){ 1309 #ifndef WIN32 1309 1310 int saved_stdout = zDup (fileno (stdout)); 1310 1311 zDup2 (fileno (stderr), fileno (stdout)); 1312 #endif 1311 1313 if(createRegistry (m,&zooRegistry,reg->value)<0){ 1312 1314 map *message=getMapFromMaps(m,"lenv","message"); … … 1317 1319 return 0; 1318 1320 } 1321 #ifndef WIN32 1319 1322 zDup2 (saved_stdout, fileno (stdout)); 1320 1323 zClose(saved_stdout); 1324 #endif 1321 1325 } 1322 1326 … … 1770 1774 free (REQUEST); 1771 1775 closedir (dirp); 1772 //xmlFreeDoc (doc); 1776 if (corig != NULL) 1777 free (corig); 1778 xmlFreeDoc (doc); 1773 1779 xmlCleanupParser (); 1774 1780 zooXmlCleanupNs (); … … 1779 1785 if (corig != NULL) 1780 1786 free (corig); 1781 } 1787 } 1782 1788 } 1783 1789 closedir (dirp); … … 2062 2068 #endif 2063 2069 #endif 2070 2064 2071 #ifdef DEBUG 2065 2072 fprintf (stderr, "[ZOO: setenv (%s=%s)]\n", mapcs->name,
Note: See TracChangeset
for help on using the changeset viewer.