Changeset 933 for branches/prototype-v0/zoo-project
- Timestamp:
- May 31, 2019, 3:03:21 PM (6 years ago)
- Location:
- branches/prototype-v0/zoo-project/zoo-kernel
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/mimetypes.h
r854 r933 839 839 840 840 static int isGeographic(const char* mimeType){ 841 c har* imageMimeType[4]={841 const char* imageMimeType[4]={ 842 842 "image/tiff", 843 843 "image/png", … … 845 845 "application/vnd.google-earth.kmz" 846 846 }; 847 c har* vectorMimeType[5]={847 const char* vectorMimeType[5]={ 848 848 "text/xml", 849 849 "application/json", -
branches/prototype-v0/zoo-project/zoo-kernel/request_parser.c
r908 r933 783 783 maps *tmpConf=createMaps("main"); 784 784 tmpConf->content=createMap("memory","load"); 785 static char PROC_NAME[] = "ZooWPSClient"; 785 786 bInternet = InternetOpen ( 786 787 #ifndef WIN32 787 788 (LPCTSTR) 788 789 #endif 789 "ZooWPSClient\0",790 PROC_NAME, 790 791 INTERNET_OPEN_TYPE_PRECONFIG, 791 792 NULL, NULL, 0); -
branches/prototype-v0/zoo-project/zoo-kernel/server_internal.c
r910 r933 601 601 */ 602 602 char* addDefaultValues(maps** out,elements* in,maps* m,int type,map** err){ 603 static char EMPTY[] = ""; 603 604 map *res=*err; 604 605 elements* tmpInputs=in; … … 738 739 * content map. 739 740 */ 740 c har* keys[4]={741 const char* keys[4]={ 741 742 "minOccurs", 742 743 "maxOccurs", … … 882 883 return result; 883 884 } 884 return "";885 return EMPTY; 885 886 } 886 887 … … 1133 1134 map* statusInfo=createMap("JobID",pid); 1134 1135 addToMap(statusInfo,"Status","Dismissed"); 1135 printStatusInfo(conf,statusInfo, "Dismiss");1136 printStatusInfo(conf,statusInfo, (char*) "Dismiss"); 1136 1137 free(statusInfo); 1137 1138 } -
branches/prototype-v0/zoo-project/zoo-kernel/service_callback.c
r899 r933 127 127 maps* tmpConf=createMaps("main"); 128 128 tmpConf->content=createMap("memory","load"); 129 hInternet=InternetOpen("ZooWPSClient\0", 129 static char PROC_NAME[] = "ZooWPSClient"; 130 hInternet=InternetOpen(PROC_NAME, 130 131 INTERNET_OPEN_TYPE_PRECONFIG, 131 132 NULL,NULL, 0); … … 435 436 maps* curs=inputs; 436 437 dumpMaps(curs); 437 c har *keys[11][2]={438 const char *keys[11][2]={ 438 439 { 439 440 "xlink:href", … … 614 615 maps* curs=outputs; 615 616 dumpMaps(curs); 616 c har *keys[10][2]={617 const char *keys[10][2]={ 617 618 { 618 619 "Reference", … … 656 657 } 657 658 }; 658 c har* specifics[5][2]={659 const char* specifics[5][2]={ 659 660 { 660 661 "download_link", … … 767 768 case 6: { 768 769 // Finalize HPC 769 c har *keys[6][2]={770 const char *keys[6][2]={ 770 771 { 771 772 //"SubmitTime", -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal.c
r899 r933 99 99 struct zooLock* myLock=(struct zooLock*)malloc(sizeof(struct flock)+sizeof(FILE*)+sizeof(char*)); 100 100 int len=6; 101 char *myTemplate="%s.lock";101 static const char myTemplate[] = "%s.lock"; 102 102 int res=-1; 103 103 retryLockFile: … … 172 172 } 173 173 if(res<0){ 174 char *tmp;175 if (errno==EBADF)176 tmp="Either: the filedes argument is invalid; you requested a read lock but the filedes is not open for read access; or, you requested a write lock but the filedes is not open for write access.";174 char tmp[512]; 175 if (errno == EBADF) 176 strncpy(tmp, "Either: the filedes argument is invalid; you requested a read lock but the filedes is not open for read access; or, you requested a write lock but the filedes is not open for write access.", 512); 177 177 else 178 if(errno==EINVAL)179 tmp="Either the lockp argument doesn’t specify valid lock information, or the file associated with filedes doesn’t support locks.";180 181 tmp="The system has run out of file lock resources; there are already too many file locks in place.";178 if (errno == EINVAL) 179 strncpy(tmp, "Either the lockp argument doesn’t specify valid lock information, or the file associated with filedes doesn’t support locks.", 512); 180 else 181 strncpy(tmp, "The system has run out of file lock resources; there are already too many file locks in place.", 512); 182 182 #ifdef DEBUG 183 183 fprintf(stderr,"Unable to get the lock on %s due to the following error: %s\n",myLock->filename,tmp); … … 317 317 } 318 318 if(hasFile>0){ 319 semid lockid ;319 semid lockid = NULL; // knut: add initialization 320 320 char* stat=getStatusId(conf,pid); 321 321 if(stat!=NULL){ … … 505 505 506 506 semid getShmLockId(maps* conf, int nsems){ 507 semid sem_id; 507 semid sem_id; 508 508 char key[MAX_PATH]; 509 509 getKeyValue(conf, key, MAX_PATH); 510 510 511 sem_id = CreateSemaphore( NULL, nsems, nsems+1, key); 511 //sem_id = CreateSemaphore( NULL, nsems, nsems+1, key); knut: CreateSemaphore may alias to wide-character version CreateSemaphoreW 512 sem_id = CreateSemaphoreA( NULL, nsems, nsems+1, key); 512 513 if(sem_id==NULL){ 513 514 #ifdef DEBUG … … 564 565 565 566 char* getStatus(int pid){ 567 static char err[] = "-1"; 568 566 569 char *lpszBuf=(char*) malloc(SHMEMSIZE*sizeof(char)); 567 570 int i=0; … … 584 587 fprintf(stderr,"ERROR on line %d\n",__LINE__); 585 588 #endif 586 return "-1"; 589 //return "-1"; 590 return err; 587 591 } 588 592 if((GetLastError() != ERROR_ALREADY_EXISTS)){ … … 593 597 fIgnore = UnmapViewOfFile(lpvMem); 594 598 fIgnore = CloseHandle(hMapObject); 595 return "-1"; 599 //return "-1"; 600 return err; 596 601 } 597 602 fInit=TRUE; … … 608 613 fprintf(stderr,"READING STRING S %s\n", getLastErrorMessage()); 609 614 #endif 610 return "-1"; 615 //return "-1"; 616 return err; 611 617 } 612 618 lpszTmp = (LPWSTR) lpvMem; -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal.h
r900 r933 67 67 #include <sys/stat.h> 68 68 #include <sys/types.h> 69 #include "cgic.h" 69 70 #ifndef WIN32 70 71 #include <sys/ipc.h> -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_mono.c
r896 r933 55 55 MonoImage* monoImage; 56 56 57 char* libPath="/usr/lib"; 58 char* etcPath="/etc"; 57 static char LIB[] = "/usr/lib"; 58 static char ETC[] = "/etc"; 59 60 char* libPath = LIB; 61 char* etcPath = ETC; 59 62 map* libPathMap=getMapFromMaps(*main_conf,"mono","lib"); 60 63 map* etcPathMap=getMapFromMaps(*main_conf,"mono","etc"); … … 84 87 //MonoDomain* monoDomain = mono_jit_init("ZOO_Embedded_Domain"); 85 88 86 c har* ZMapsLib = "ZMaps.dll";89 const char* ZMapsLib = "ZMaps.dll"; 87 90 char *zooAssembly = NULL; 88 91 -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_ms.c
r898 r933 1288 1288 * First store the value on disk 1289 1289 */ 1290 static char DATA[] = "data"; 1291 static char JSON[] = "json"; 1290 1292 int imyIndex=getPublishedId(outputs); 1291 1293 map* mime=getMapArray(outputs->content,"mimeType",imyIndex); 1292 1294 map* msUrl=getMapFromMaps(conf,"main","mapserverAddress"); 1293 1295 map* dataPath=getMapFromMaps(conf,"main","dataPath"); 1294 char *ext ="data";1295 if (mime!=NULL)1296 if (strncasecmp(mime->value,"application/json",16)==0)1297 ext ="json";1296 char *ext = DATA; 1297 if (mime != NULL) 1298 if (strncasecmp(mime->value, "application/json", 16) == 0) 1299 ext = JSON; 1298 1300 1299 1301 map* storage=getMapArray(outputs->content,"storage",imyIndex); -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_python.c
r896 r933 151 151 152 152 #ifdef WIN32 153 c har* os_pathsep = ";";153 const char* os_pathsep = ";"; 154 154 #else 155 char* os_pathsep = ":"; 156 #endif 155 const char* os_pathsep = ":"; 156 #endif 157 static char EMPTY[] = ""; 157 158 158 159 maps* m=*main_conf; … … 171 172 } 172 173 else { 173 libPath = ""; 174 //libPath = ""; 175 libPath = EMPTY; 174 176 } 175 177 -
branches/prototype-v0/zoo-project/zoo-kernel/sqlapi.c
r890 r933 71 71 maps* cconf=getMaps(conf,key); 72 72 if(cconf==NULL){ 73 fprintf(stderr,"%s %d\n",__FILE__,__LINE__); 74 return "-1"; 73 fprintf(stderr,"%s %d\n",__FILE__,__LINE__); 74 static char err[] = "-1"; 75 return err; 75 76 } 76 77 int len=0; -
branches/prototype-v0/zoo-project/zoo-kernel/ulinet.c
r899 r933 32 32 #include <assert.h> 33 33 #include <ctype.h> 34 #include "fcgi_stdio.h"35 34 36 35 /** … … 270 269 char* getProvenance(maps* conf,const char* url){ 271 270 map* sharedCache=getMapFromMaps(conf,"security","shared"); 272 char *res="OTHER"; 273 char *paths[2]={ 271 //char *res="OTHER"; 272 static char OTHER[] = "OTHER"; 273 static char SHARED[] = "SHARED"; 274 static char LOCAL[] = "LOCAL"; 275 const char *paths[2]={ 274 276 "mapserverAddress", 275 277 "tmpUrl" … … 280 282 while(curs!=NULL){ 281 283 if(strstr(url,curs)==NULL){ 282 return "SHARED";284 return SHARED; 283 285 } 284 286 curs=strtok(NULL,","); … … 289 291 if(sharedCache!=NULL){ 290 292 if(strstr(url,sharedCache->value)!=NULL){ 291 return "LOCAL"; 292 } 293 } 294 } 295 return res; 293 return LOCAL; 294 } 295 } 296 } 297 //return res; 298 return OTHER; 296 299 } 297 300 -
branches/prototype-v0/zoo-project/zoo-kernel/ulinet.h
r899 r933 25 25 #ifndef _ULINET_H 26 26 #define _ULINET_H 27 28 #include "fcgi_stdio.h" 27 29 28 30 #include <stdlib.h> … … 77 79 struct curl_slist *header; //!< the headers to send 78 80 char* filename; //!< the cached file name 79 FILE* file; //!< the file pointer 81 FILE* file; //!< the file pointer 80 82 unsigned char *pabyData; //!< the downloaded content 81 83 char *url; //!< the url used to access the server -
branches/prototype-v0/zoo-project/zoo-kernel/zoo_service_loader.c
r914 r933 854 854 char* filepath = kvp + strlen(key); 855 855 strncpy(kvp, key, strlen(key)); 856 addToCache(m, tmpReq->value, tmpReq->value, "text/xml", strlen(tmpReq->value),856 addToCache(m, tmpReq->value, tmpReq->value, (char*) "text/xml", strlen(tmpReq->value), 857 857 filepath, FILENAME_MAX); 858 858 if (filepath == NULL) { … … 2001 2001 #ifndef WIN32 2002 2002 (LPCTSTR) 2003 #else 2004 (char*) 2003 2005 #endif 2004 2006 "ZooWPSClient\0",
Note: See TracChangeset
for help on using the changeset viewer.