Changeset 673
- Timestamp:
- Jun 17, 2015, 5:52:29 PM (9 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/Makefile.in
r653 r673 46 46 47 47 response_print.o: response_print.c response_print.h 48 g++ -fPIC ${ XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c response_print.c48 g++ -fPIC ${GDAL_CFLAGS} ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c response_print.c 49 49 50 50 server_internal.o: server_internal.c server_internal.h service.h mimetypes.h -
trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in
r653 r673 94 94 95 95 CFLAGS=@RELY_ON_DB@ @DEB_DEF@ -fpic ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF 96 LDFLAGS=-lzoo_service -lcurl-L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto -luuid ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS}96 LDFLAGS=-lzoo_service @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto -luuid ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} 97 97 -
trunk/zoo-project/zoo-kernel/configure.ac
r652 r673 10 10 # Checks for libraries. 11 11 AC_CHECK_LIB([cgic], [cgiMain]) 12 AC_CHECK_LIB([curl], [curl_easy_init curl_easy_setopt curl_easy_cleanupcurl_easy_perform])13 AC_CHECK_LIB([dl], [dlopen dlsym dlerrordlclose])12 AC_CHECK_LIB([curl], [curl_easy_init,curl_easy_setopt,curl_easy_cleanup,curl_easy_perform]) 13 AC_CHECK_LIB([dl], [dlopen,dlsym,dlerror,dlclose]) 14 14 AC_CHECK_LIB([fl], [main]) 15 15 AC_CHECK_LIB([pthread], [main]) 16 16 AC_CHECK_LIB([ssl], [main]) 17 18 DEFAULT_LIBS="$LIBS" 19 AC_SUBST([DEFAULT_LIBS]) 20 17 21 18 22 # Checks for header files. -
trunk/zoo-project/zoo-kernel/main.cfg
r539 r673 8 8 dataPath = /tmp/ 9 9 cacheDir = /tmp/ 10 10 11 11 12 [identification] -
trunk/zoo-project/zoo-kernel/response_print.c
r666 r673 451 451 xmlAddChild(nc,nc2); 452 452 nc2 = xmlNewNode(ns_ows, BAD_CAST "ServiceTypeVersion"); 453 dumpMaps(m);454 453 map* tmpv=getMapFromMaps(m,"main","rversion"); 455 454 xmlAddChild(nc2,xmlNewText(BAD_CAST tmpv->value)); … … 1914 1913 strcasecmp(tmp->name,"datatype")==0 || 1915 1914 strcasecmp(tmp->name,"uom")==0) { 1916 1917 xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value); 1918 } 1915 1916 if(vid==0) 1917 xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value); 1918 else{ 1919 if(strcasecmp(tmp->name,"datatype")==0) 1920 xmlNewProp(nc2,BAD_CAST "mimeType",BAD_CAST "text/plain"); 1921 else 1922 if(strcasecmp(tmp->name,"uom")!=0) 1923 xmlNewProp(nc2,BAD_CAST tmp->name,BAD_CAST tmp->value); 1924 } 1925 } 1926 if(vid==0) 1927 xmlAddChild(nc2,nc3); 1919 1928 tmp=tmp->next; 1920 xmlAddChild(nc2,nc3);1921 1929 } 1922 1930 if(e!=NULL && e->format!=NULL && strcasecmp(e->format,"BoundingBoxData")==0) { … … 1970 1978 } 1971 1979 1972 xmlAddChild( nc3,xmlNewText(BAD_CAST base64(tmp3->value, atoi(rs->value)))); // base 64 encode in XML1980 xmlAddChild((vid==0?nc3:nc2),xmlNewText(BAD_CAST base64(tmp3->value, atoi(rs->value)))); // base 64 encode in XML 1973 1981 1974 1982 if(tmp1==NULL || (tmp1!=NULL && strncmp(tmp1->value,"base64",6)!=0)) { 1975 xmlAttrPtr ap = xmlHasProp( nc3, BAD_CAST "encoding");1983 xmlAttrPtr ap = xmlHasProp((vid==0?nc3:nc2), BAD_CAST "encoding"); 1976 1984 if (ap != NULL) { 1977 1985 xmlRemoveProp(ap); 1978 1986 } 1979 xmlNewProp( nc3,BAD_CAST "encoding",BAD_CAST "base64");1987 xmlNewProp((vid==0?nc3:nc2),BAD_CAST "encoding",BAD_CAST "base64"); 1980 1988 } 1981 1989 … … 1990 1998 strstr(tmp2->value, "ecmascript") != NULL 1991 1999 ) { 1992 xmlAddChild( nc3,xmlNewCDataBlock(doc,BAD_CAST tmp3->value,strlen(tmp3->value)));2000 xmlAddChild((vid==0?nc3:nc2),xmlNewCDataBlock(doc,BAD_CAST tmp3->value,strlen(tmp3->value))); 1993 2001 } 1994 2002 else { // else … … 2002 2010 xmlDocPtr doc = iDocs[li]; 2003 2011 xmlNodePtr ir = xmlDocGetRootElement(doc); 2004 xmlAddChild( nc3,ir);2012 xmlAddChild((vid==0?nc3:nc2),ir); 2005 2013 } 2006 2014 else // else 2007 xmlAddChild( nc3,xmlNewText(BAD_CAST tmp3->value)); // add text node2015 xmlAddChild((vid==0?nc3:nc2),xmlNewText(BAD_CAST tmp3->value)); // add text node 2008 2016 } 2009 2017 xmlAddChild(nc2,nc3); 2010 2018 } 2011 2019 else { 2012 xmlAddChild( nc3,xmlNewText(BAD_CAST tmp3->value));2020 xmlAddChild((vid==0?nc3:nc2),xmlNewText(BAD_CAST tmp3->value)); 2013 2021 } 2014 2022 -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r667 r673 206 206 createRegistry (maps* m,registry ** r, char *reg_dir, int saved_stdout) 207 207 { 208 struct dirent *dp; 209 int scount = 0; 210 208 char registryKeys[3][15]={ 209 "concept", 210 "generic", 211 "implementation" 212 }; 213 int scount = 0,i=0; 211 214 if (reg_dir == NULL) 212 215 return 0; 213 DIR *dirp = opendir (reg_dir); 214 if (dirp == NULL) 215 { 216 return -1; 217 } 218 while ((dp = readdir (dirp)) != NULL){ 219 if ((dp->d_type == DT_DIR || dp->d_type == DT_LNK) && dp->d_name[0] != '.') 220 { 221 222 char * tmpName = 223 (char *) malloc ((strlen (reg_dir) + strlen (dp->d_name) + 2) * 224 sizeof (char)); 225 sprintf (tmpName, "%s/%s", reg_dir, dp->d_name); 226 227 DIR *dirp1 = opendir (tmpName); 228 struct dirent *dp1; 229 while ((dp1 = readdir (dirp1)) != NULL){ 230 char* extn = strstr(dp1->d_name, ".zcfg"); 231 if(dp1->d_name[0] != '.' && extn != NULL && strlen(extn) == 5) 216 for(i=0;i<3;i++){ 217 char * tmpName = 218 (char *) malloc ((strlen (reg_dir) + strlen (registryKeys[i]) + 2) * 219 sizeof (char)); 220 sprintf (tmpName, "%s/%s", reg_dir, registryKeys[i]); 221 222 DIR *dirp1 = opendir (tmpName); 223 struct dirent *dp1; 224 while ((dp1 = readdir (dirp1)) != NULL){ 225 char* extn = strstr(dp1->d_name, ".zcfg"); 226 if(dp1->d_name[0] != '.' && extn != NULL && strlen(extn) == 5) 227 { 228 int t; 229 char *tmps1= 230 (char *) malloc ((strlen (tmpName) + strlen (dp1->d_name) + 2) * 231 sizeof (char)); 232 sprintf (tmps1, "%s/%s", tmpName, dp1->d_name); 233 char *tmpsn = zStrdup (dp1->d_name); 234 tmpsn[strlen (tmpsn) - 5] = 0; 235 service* s1 = (service *) malloc (SERVICE_SIZE); 236 if (s1 == NULL) 232 237 { 233 int t; 234 char *tmps1= 235 (char *) malloc ((strlen (tmpName) + strlen (dp1->d_name) + 2) * 236 sizeof (char)); 237 sprintf (tmps1, "%s/%s", tmpName, dp1->d_name); 238 char *tmpsn = zStrdup (dp1->d_name); 239 tmpsn[strlen (tmpsn) - 5] = 0; 240 service* s1 = (service *) malloc (SERVICE_SIZE); 241 if (s1 == NULL) 242 { 243 dup2 (saved_stdout, fileno (stdout)); 244 errorException (m, _("Unable to allocate memory."), 245 "InternalError", NULL); 246 return -1; 247 } 248 t = readServiceFile (m, tmps1, &s1, tmpsn); 249 free (tmpsn); 250 if (t < 0) 251 { 252 map *tmp00 = getMapFromMaps (m, "lenv", "message"); 253 char tmp01[1024]; 254 if (tmp00 != NULL) 255 sprintf (tmp01, _("Unable to parse the ZCFG file: %s (%s)"), 256 dp1->d_name, tmp00->value); 257 else 258 sprintf (tmp01, _("Unable to parse the ZCFG file: %s."), 259 dp1->d_name); 260 dup2 (saved_stdout, fileno (stdout)); 261 errorException (m, tmp01, "InternalError", NULL); 262 return -1; 263 } 264 #ifdef DEBUG 265 dumpService (s1); 266 fflush (stdout); 267 fflush (stderr); 268 #endif 269 if(strncasecmp(dp->d_name,"implementation",14)==0){ 270 inheritance(*r,&s1); 271 } 272 addServiceToRegistry(r,dp->d_name,s1); 273 freeService (&s1); 274 free (s1); 275 scount++; 238 dup2 (saved_stdout, fileno (stdout)); 239 errorException (m, _("Unable to allocate memory."), 240 "InternalError", NULL); 241 return -1; 276 242 } 243 t = readServiceFile (m, tmps1, &s1, tmpsn); 244 free (tmpsn); 245 if (t < 0) 246 { 247 map *tmp00 = getMapFromMaps (m, "lenv", "message"); 248 char tmp01[1024]; 249 if (tmp00 != NULL) 250 sprintf (tmp01, _("Unable to parse the ZCFG file: %s (%s)"), 251 dp1->d_name, tmp00->value); 252 else 253 sprintf (tmp01, _("Unable to parse the ZCFG file: %s."), 254 dp1->d_name); 255 dup2 (saved_stdout, fileno (stdout)); 256 errorException (m, tmp01, "InternalError", NULL); 257 return -1; 258 } 259 #ifdef DEBUG 260 dumpService (s1); 261 fflush (stdout); 262 fflush (stderr); 263 #endif 264 if(strncasecmp(registryKeys[i],"implementation",14)==0){ 265 inheritance(*r,&s1); 266 } 267 addServiceToRegistry(r,registryKeys[i],s1); 268 freeService (&s1); 269 free (s1); 270 scount++; 277 271 } 278 (void) closedir (dirp1); 279 }272 } 273 (void) closedir (dirp1); 280 274 } 281 (void) closedir (dirp);282 275 return 0; 283 276 }
Note: See TracChangeset
for help on using the changeset viewer.