Changeset 459 for trunk/zoo-project
- Timestamp:
- Apr 1, 2014, 11:32:29 PM (11 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/Makefile.in
r446 r459 1 include ZOOMakefile.opts 2 1 3 OS:=$(shell uname -s) 2 4 ifeq ($(OS),Darwin) … … 10 12 JAVA_FILE=@JAVA_FILE@ 11 13 12 MS_CFLAGS=@MS_CFLAGS@13 MS_LDFLAGS=@MS_LIBS@14 MS_FILE=@MS_FILE@15 16 14 CFLAGS=-fpic ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF 17 15 LDFLAGS=-lcurl -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto ${MS_LDFLAGS} ${MACOS_LD_FLAGS} … … 22 20 PHP_FILE=@PHP_FILE@ 23 21 24 25 PYTHONCFLAGS=@PYTHON_CPPFLAGS@26 PYTHONLDFLAGS=@PYTHON_LDFLAGS@27 PYTHON_ENABLED=@PYTHON_ENABLED@28 PYTHON_FILE=@PYTHON_FILE@29 30 JSCFLAGS=@JS_CPPFLAGS@31 JSLDFLAGS=@JS_LDFLAGS@32 JS_ENABLED=@JS_ENABLED@33 JS_FILE=@JS_FILE@34 35 XML2CFLAGS=@XML2_CPPFLAGS@36 XML2LDFLAGS=@XML2_LDFLAGS@37 38 GDAL_CFLAGS=@GDAL_CFLAGS@39 GDAL_LIBS=@GDAL_LIBS@40 22 41 23 PERLCFLAGS=@PERL_CPPFLAGS@ … … 89 71 gcc -c ${XML2CFLAGS} ${PERLCFLAGS} ${CFLAGS} ${PERL_ENABLED} service_internal_perl.c 90 72 91 92 73 service_internal_java.o: service_internal_java.c service.h 93 74 gcc -c ${XML2CFLAGS} ${JAVACFLAGS} ${CFLAGS} ${JAVA_ENABLED} service_internal_java.c … … 96 77 gcc ${XML2CFLAGS} ${JSCFLAGS} ${CFLAGS} ${JS_ENABLED} -c service_internal_js.c 97 78 79 service_internal_ruby.o: service_internal_ruby.c service_internal_ruby.h 80 g++ ${XML2CFLAGS} ${RUBYCFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c service_internal_ruby.c 98 81 99 82 service_loader.o: service_loader.c service.h … … 103 86 g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} -c zoo_service_loader.c -fno-common -DPIC -o zoo_service_loader.o 104 87 105 zoo_loader.cgi: 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 service_internal.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} 106 g++ -g -O2 ${JSCFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c -fno-common -DPIC -o zoo_loader.o88 zoo_loader.cgi: 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 service_internal.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} 89 g++ -g -O2 ${JSCFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${RUBYCFLAGS} ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c -fno-common -DPIC -o zoo_loader.o 107 90 g++ ${JSCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o service_internal.o ${MS_FILE} ${PYTHON_FILE} ${PERL_FILE} ${PHP_FILE} ${JS_FILE} ${JAVA_FILE} ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi ${LDFLAGS} 108 91 -
trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in
r303 r459 14 14 PYTHONCFLAGS=@PYTHON_CPPFLAGS@ 15 15 PYTHONLDFLAGS=@PYTHON_LDFLAGS@ 16 PYTHON_ENABLED=@PYTHON_ENABLED@ 17 PYTHON_FILE=@PYTHON_FILE@ 18 19 RUBYCFLAGS=@RUBY_CPPFLAGS@ 20 RUBYLDFLAGS=@RUBY_LDFLAGS@ 21 RUBY_ENABLED=@RUBY_ENABLED@ 22 RUBY_FILE=@RUBY_FILE@ 16 23 17 24 JS_ENABLED=@JS_ENABLED@ 18 25 JSCFLAGS=@JS_CPPFLAGS@ 19 26 JSLDFLAGS=@JS_LDFLAGS@ 27 JS_FILE=@JS_FILE@ 20 28 ifeq ($(JS_ENABLED),-DUSE_JS) 21 29 JS_LDFLAGS=${ZRPATH}/zoo-kernel/ulinet.o ${ZRPATH}/zoo-kernel/service_internal_js.o -lcurl 22 30 endif 23 31 32 MS_CFLAGS=@MS_CFLAGS@ 33 MS_LDFLAGS=@MS_LIBS@ 34 MS_FILE=@MS_FILE@ 35 24 36 ZOO_CFLAGS=-I${ZRPATH}/../thirds/cgic206/ -I${ZRPATH}/zoo-kernel/ 25 37 ZOO_LDFLAGS=-lcrypto -
trunk/zoo-project/zoo-kernel/configure.ac
r435 r459 66 66 AC_SUBST([GDAL_CFLAGS]) 67 67 AC_SUBST([GDAL_LIBS]) 68 69 # =========================================================================== 70 # Detect if fastcgi is available 71 # =========================================================================== 72 73 AC_ARG_WITH([fastcgi], 74 [AS_HELP_STRING([--with-fastcgi=PATH], [specify an alternative location for the fastcgi library])], 75 [FCGIPATH="$withval"], [FCGIPATH=""]) 76 77 # Extract the linker and include flags 78 FCGI_LDFLAGS="-L$FCGIPATH/lib" 79 FCGI_CPPFLAGS="-I$FCGIPATH/include" 80 81 # Check headers file 82 CPPFLAGS_SAVE="$CPPFLAGS" 83 CPPFLAGS="$FCGI_CPPFLAGS" 84 AC_CHECK_HEADERS([fcgi_stdio.h], 85 [], [AC_MSG_ERROR([could not find headers include related to fastcgi])]) 86 87 AC_SUBST([FCGI_CPPFLAGS]) 88 AC_SUBST([FCGI_LDFLAGS]) 89 90 # =========================================================================== 91 # Detect if proj is installed 92 # =========================================================================== 93 94 AC_ARG_WITH([proj], 95 [AS_HELP_STRING([--with-proj=PATH], [specify an alternative location for PROJ4 setup])], 96 [PROJPATH="$withval"], [PROJPATH=""]) 97 98 # Extract the linker and include flags 99 PROJ_LDFLAGS="-L$PROJPATH/lib" 100 PROJ_CPPFLAGS="-I$PROJPATH/include" 101 102 # Check headers file 103 CPPFLAGS_SAVE="$CPPFLAGS" 104 CPPFLAGS="$PROJ_CPPFLAGS" 105 AC_CHECK_HEADERS([proj_api.h], 106 [], [AC_MSG_ERROR([could not find headers include related to PROJ4])]) 107 108 AC_SUBST([PROJ_CPPFLAGS]) 109 AC_SUBST([PROJ_LDFLAGS]) 68 110 69 111 # =========================================================================== … … 154 196 155 197 # =========================================================================== 198 # Detect if ruby is installed 199 # =========================================================================== 200 AC_ARG_WITH([ruby], 201 [AS_HELP_STRING([--with-ruby=PATH], [To enable ruby support or specify an alternative directory for ruby installation, disabled by default])], 202 [RUBY_PATH="$withval"; RUBY_ENABLED="-DUSE_RUBY"], [RUBY_ENABLED=""]) 203 204 AC_ARG_WITH([rvers], 205 [AS_HELP_STRING([--with-rvers=NUM], [To use a specific ruby version])], 206 [RUBY_VERS="$withval"], [RUBY_VERS=""]) 207 208 209 if test -z "$RUBY_ENABLED" 210 then 211 RUBY_FILE="" 212 else 213 RUBY_FILE="service_internal_ruby.o" 214 215 # Extract the linker and include flags 216 RUBY_LDFLAGS="-lruby" 217 RUBY_CPPFLAGS="-I$RUBY_PATH -I$RUBY_PATH/x86_64-darwin13.0/ -DZRUBY_VERSION=$RUBY_VERS" 218 219 # Check headers file 220 CPPFLAGS_SAVE="$CPPFLAGS" 221 CPPFLAGS="$RUBY_CPPFLAGS" 222 AC_CHECK_HEADERS([ruby.h], 223 [], [AC_MSG_ERROR([could not find headers include related to libruby])]) 224 225 # Ensure we can link against libphp 226 LIBS_SAVE="$LIBS" 227 LIBS="$RUBY_LDFLAGS" 228 # AC_CHECK_LIB([lruby], [PyObject_CallObject], [], [AC_MSG_ERROR([could not find libpython])], []) 229 AC_SUBST([RUBY_CPPFLAGS]) 230 AC_SUBST([RUBY_LDFLAGS]) 231 fi 232 233 AC_SUBST([RUBY_ENABLED]) 234 AC_SUBST([RUBY_FILE]) 235 236 # =========================================================================== 156 237 # Detect if python is installed 157 238 # =========================================================================== … … 187 268 # Extract the linker and include flags 188 269 PYTHON_LDFLAGS=`$PYTHONCONFIG --ldflags` 189 PYTHON_CPPFLAGS=`$PYTHONCONFIG -- cflags`270 PYTHON_CPPFLAGS=`$PYTHONCONFIG --includes` 190 271 191 272 # Check headers file -
trunk/zoo-project/zoo-kernel/service_internal.c
r458 r459 883 883 884 884 void printFullDescription(elements *elem,const char* type,xmlNsPtr ns_ows,xmlNodePtr nc1){ 885 char *orderedFields[ 7];885 char *orderedFields[12]; 886 886 orderedFields[0]="mimeType"; 887 887 orderedFields[1]="encoding"; … … 891 891 orderedFields[5]="CRS"; 892 892 orderedFields[6]="value"; 893 894 xmlNodePtr nc2,nc3,nc4,nc5,nc6,nc7; 893 orderedFields[7]="AllowedValues"; 894 orderedFields[8]="rangeMin"; 895 orderedFields[9]="rangeMax"; 896 orderedFields[10]="rangeClosure"; 897 orderedFields[11]="rangeSpace"; 898 899 xmlNodePtr nc2,nc3,nc4,nc5,nc6,nc7,nc8; 895 900 elements* e=elem; 896 901 map* tmp1=NULL; … … 956 961 int dcnt=0; 957 962 int oI=0; 958 for(oI=0;oI< 7;oI++)963 for(oI=0;oI<12;oI++) 959 964 if((tmp1=getMap(_tmp->content,orderedFields[oI]))!=NULL){ 960 965 //while(tmp1!=NULL){ … … 977 982 strcasecmp(tmp1->name,"extension")!=0 && 978 983 strcasecmp(tmp1->name,"value")!=0 && 979 strncasecmp(tmp1->name,"AllowedValues",13)!=0){ 984 strncasecmp(tmp1->name,"AllowedValues",13)!=0&& 985 strncasecmp(tmp1->name,"range",5)!=0){ 980 986 if(datatype!=1){ 981 987 char *tmp2=zCapitalize1(tmp1->name); … … 993 999 }else 994 1000 if(strncmp(type,"Input",5)==0){ 1001 995 1002 if(strcmp(tmp1->name,"value")==0){ 996 1003 nc7 = xmlNewNode(NULL, BAD_CAST "DefaultValue"); 997 1004 xmlAddChild(nc7,xmlNewText(BAD_CAST tmp1->value)); 998 1005 default1=1; 1006 hasDefault=true; 999 1007 } 1000 1008 if(strncasecmp(tmp1->name,"AllowedValues",13)==0){ 1001 1009 nc6 = xmlNewNode(ns_ows, BAD_CAST "AllowedValues"); 1002 fprintf(stderr,"ALLOWED VALUE %s\n",tmp1->value);1003 1010 char *token,*saveptr1; 1004 1011 token=strtok_r(tmp1->value,",",&saveptr1); … … 1008 1015 tmps[strlen(tmps)]=0; 1009 1016 xmlAddChild(nc7,xmlNewText(BAD_CAST tmps)); 1010 fprintf(stderr,"strgin : %s\n",tmps);1011 1017 xmlAddChild(nc6,nc7); 1012 1018 token=strtok_r(NULL,",",&saveptr1); 1013 1019 } 1020 if(getMap(_tmp->content,"rangeMin")!=NULL || 1021 getMap(_tmp->content,"rangeMax")!=NULL || 1022 getMap(_tmp->content,"rangeClosure")!=NULL ) 1023 goto doRange; 1014 1024 xmlAddChild(nc3,nc6); 1015 1025 isAnyValue=-1; 1016 1026 } 1017 hasDefault=true; 1027 if(strncasecmp(tmp1->name,"range",5)==0){ 1028 if(isAnyValue==1){ 1029 nc6 = xmlNewNode(ns_ows, BAD_CAST "AllowedValues"); 1030 doRange: 1031 nc8 = xmlNewNode(ns_ows, BAD_CAST "Range"); 1032 map *tmp0=getMap(tmp1,"rangeMin"); 1033 if(tmp0!=NULL){ 1034 nc7 = xmlNewNode(ns_ows, BAD_CAST "MinimumValue"); 1035 xmlAddChild(nc7,xmlNewText(BAD_CAST tmp0->value)); 1036 xmlAddChild(nc8,nc7); 1037 }else{ 1038 nc7 = xmlNewNode(ns_ows, BAD_CAST "MinimumValue"); 1039 xmlAddChild(nc8,nc7); 1040 } 1041 tmp0=getMap(tmp1,"rangeMax"); 1042 if(tmp0!=NULL){ 1043 nc7 = xmlNewNode(ns_ows, BAD_CAST "MaximumValue"); 1044 xmlAddChild(nc7,xmlNewText(BAD_CAST tmp0->value)); 1045 xmlAddChild(nc8,nc7); 1046 }else{ 1047 nc7 = xmlNewNode(ns_ows, BAD_CAST "MaximumValue"); 1048 xmlAddChild(nc8,nc7); 1049 } 1050 tmp0=getMap(tmp1,"rangeSpacing"); 1051 if(tmp0!=NULL){ 1052 nc7 = xmlNewNode(ns_ows, BAD_CAST "Spacing"); 1053 xmlAddChild(nc7,xmlNewText(BAD_CAST tmp0->value)); 1054 xmlAddChild(nc8,nc7); 1055 } 1056 tmp0=getMap(tmp1,"rangeClosure"); 1057 if(tmp0!=NULL){ 1058 char *tmp="closed"; 1059 if(strcasecmp(tmp0->value,"co")==0) 1060 tmp="closed-open"; 1061 else 1062 if(strcasecmp(tmp0->value,"oc")==0) 1063 tmp="open-closed"; 1064 else 1065 if(strcasecmp(tmp0->value,"o")==0) 1066 tmp="open"; 1067 xmlNewNsProp(nc8,ns_ows,BAD_CAST "rangeClosure",BAD_CAST tmp); 1068 }else 1069 xmlNewNsProp(nc8,ns_ows,BAD_CAST "rangeClosure",BAD_CAST "closed"); 1070 } 1071 xmlAddChild(nc6,nc8); 1072 xmlAddChild(nc3,nc6); 1073 isAnyValue=-1; 1074 } 1018 1075 } 1019 1076 tmp1=tmp1->next; … … 1026 1083 xmlAddChild(nc3,nc5); 1027 1084 } 1028 1029 1085 if(strncmp(type,"Input",5)==0){ 1030 if(datatype==1 && isAnyValue==1 && avcnt==0){ 1031 xmlAddChild(nc3,xmlNewNode(ns_ows, BAD_CAST "AnyValue")); 1032 hasDefault=true; 1033 avcnt++; 1034 } 1035 if(datatype==1 && default1>0){ 1086 if(datatype==1 && isAnyValue==1 && default1>0){ 1036 1087 xmlAddChild(nc3,nc7); 1037 1088 } 1038 1089 } 1039 } 1090 1091 } 1092 if(strncmp(type,"Input",5)==0){ 1093 if(datatype==1 && isAnyValue==1 && avcnt==0){ 1094 xmlAddChild(nc3,xmlNewNode(ns_ows, BAD_CAST "AnyValue")); 1095 hasDefault=true; 1096 avcnt++; 1097 } 1098 } 1040 1099 } 1041 1100 … … 1119 1178 xmlAddChild(nc3,nc4); 1120 1179 xmlAddChild(nc2,nc3); 1121 } else if(datatype!=2){1122 if(hasDefault!=true && strncmp(type,"Input",5)==0 )1180 }/*else if(datatype!=2){ 1181 if(hasDefault!=true && strncmp(type,"Input",5)==0 && isAnyValue==1) 1123 1182 xmlAddChild(nc3,xmlNewNode(ns_ows, BAD_CAST "AnyValue")); 1124 } 1183 }*/ 1125 1184 1126 1185 xmlAddChild(nc1,nc2); … … 1772 1831 maps* tmpMap=getMaps(m,"main"); 1773 1832 char *encoding=getEncoding(tmpMap); 1833 char *exceptionCode; 1834 1835 map* tmp=getMap(s,"code"); 1836 if(tmp!=NULL){ 1837 if(strcmp(tmp->value,"OperationNotSupported")==0) 1838 exceptionCode="501 Not Implemented"; 1839 else 1840 if(strcmp(tmp->value,"MissingParameterValue")==0 || 1841 strcmp(tmp->value,"InvalidUpdateSequence")==0 || 1842 strcmp(tmp->value,"OptionNotSupported")==0 || 1843 strcmp(tmp->value,"VersionNegotiationFailed")==0 || 1844 strcmp(tmp->value,"InvalidParameterValue")==0) 1845 exceptionCode="400 Bad request"; 1846 else 1847 if(strcmp(tmp->value,"NoApplicableCode")==0) 1848 exceptionCode="501 Internal Server Error"; 1849 else 1850 exceptionCode="501 Internal Server Error"; 1851 } 1852 else 1853 exceptionCode="501 Internal Server Error"; 1854 1774 1855 if(m!=NULL){ 1775 1856 map *tmpSid=getMapFromMaps(m,"lenv","sid"); … … 1777 1858 if( getpid()==atoi(tmpSid->value) ){ 1778 1859 printHeaders(m); 1779 printf("Content-Type: text/xml; charset=%s\r\nStatus: 200 OK\r\n\r\n",encoding);1860 printf("Content-Type: text/xml; charset=%s\r\nStatus: %s\r\n\r\n",encoding,exceptionCode); 1780 1861 } 1781 1862 } 1782 1863 else{ 1783 1864 printHeaders(m); 1784 printf("Content-Type: text/xml; charset=%s\r\nStatus: 200 OK\r\n\r\n",encoding);1865 printf("Content-Type: text/xml; charset=%s\r\nStatus: %s\r\n\r\n",encoding,exceptionCode); 1785 1866 } 1786 1867 }else{ 1787 printf("Content-Type: text/xml; charset=%s\r\nStatus: 200 OK\r\n\r\n",encoding);1868 printf("Content-Type: text/xml; charset=%s\r\nStatus: %s\r\n\r\n",encoding,exceptionCode); 1788 1869 } 1789 1870 n=createExceptionReportNode(m,s,1); … … 1829 1910 else 1830 1911 xmlNewProp(nc,BAD_CAST "exceptionCode",BAD_CAST "NoApplicableCode"); 1912 1913 tmp=getMap(s,"locator"); 1914 if(tmp!=NULL && strcasecmp(tmp->value,"NULL")!=0) 1915 xmlNewProp(nc,BAD_CAST "locator",BAD_CAST tmp->value); 1916 1831 1917 1832 1918 tmp=getMap(s,"text"); … … 2630 2716 fcontent=(char*)malloc((res.nDataLen+1)*sizeof(char)); 2631 2717 if(fcontent == NULL){ 2632 return errorException(m, _("Unable to allocate memory."), "InternalError" );2718 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 2633 2719 } 2634 2720 size_t dwRead; … … 2639 2725 } 2640 2726 if(fsize==0){ 2641 return errorException(m, _("Unable to download the file."), "InternalError" );2727 return errorException(m, _("Unable to download the file."), "InternalError",NULL); 2642 2728 } 2643 2729 … … 2668 2754 } 2669 2755 2670 int errorException(maps *m, const char *message, const char *errorcode )2756 int errorException(maps *m, const char *message, const char *errorcode, const char *locator) 2671 2757 { 2672 2758 map* errormap = createMap("text", message); 2673 2759 addToMap(errormap,"code", errorcode); 2760 if(locator!=NULL) 2761 addToMap(errormap,"locator", locator); 2762 else 2763 addToMap(errormap,"locator", "NULL"); 2674 2764 printExceptionReportResponse(m,errormap); 2675 2765 freeMap(&errormap); -
trunk/zoo-project/zoo-kernel/service_internal.h
r453 r459 132 132 char* addDefaultValues(maps**,elements*,maps*,int); 133 133 134 int errorException(maps * m, const char *message, const char *errorcode);134 int errorException(maps *, const char *, const char *, const char*); 135 135 136 136 int checkForSoapEnvelope(xmlDocPtr); -
trunk/zoo-project/zoo-kernel/service_internal_ruby.c
r453 r459 369 369 if (istatus < 0 || istatus > 100){ 370 370 fprintf(stderr,"Status must be a percentage."); 371 return NULL;371 return Qnil; 372 372 }else{ 373 373 char tmpStatus[4]; -
trunk/zoo-project/zoo-kernel/zoo_loader.c
r458 r459 110 110 } 111 111 if(res==NULL && (strQuery==NULL || strlen(strQuery)==0)){ 112 return errorException(NULL,"ZOO-Kernel failed to process your request cause the request was emtpty.","InternalError" );112 return errorException(NULL,"ZOO-Kernel failed to process your request cause the request was emtpty.","InternalError",NULL); 113 113 }else{ 114 114 if(strQuery==NULL || strlen(strQuery)==0) -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r458 r459 152 152 char emsg[1024]; 153 153 sprintf(emsg,_("You set maximum occurences for <%s> as %i but you tried to use it more than the limit you set. Please correct your ZCFG file or your request."),mi->name,atoi(testMap->value)); 154 errorException(m,emsg,"InternalError" );154 errorException(m,emsg,"InternalError",NULL); 155 155 return -1; 156 156 } … … 165 165 map* tmpMap=getMap(mi->content,"length"); 166 166 sprintf(emsg,_("ZOO-Kernel was unable to load your data for %s position %s."),mi->name,tmpMap->value); 167 errorException(m,emsg,"InternalError" );167 errorException(m,emsg,"InternalError",NULL); 168 168 return -1; 169 169 } … … 172 172 char emsg[1024]; 173 173 sprintf(emsg,_("You set maximum occurences for <%s> to one but you tried to use it more than once. Please correct your ZCFG file or your request."),mi->name); 174 errorException(m,emsg,"InternalError" );174 errorException(m,emsg,"InternalError",NULL); 175 175 return -1; 176 176 } … … 221 221 } 222 222 sprintf(tmp,_("ZOO Kernel failed to process your request receiving signal %d = %s"),sig,ssig); 223 errorException(NULL, tmp, "InternalError" );223 errorException(NULL, tmp, "InternalError",NULL); 224 224 #ifdef DEBUG 225 225 fprintf(stderr,"Not this time!\n"); … … 556 556 m=(maps*)malloc(MAPS_SIZE); 557 557 if(m == NULL){ 558 return errorException(m, _("Unable to allocate memory."), "InternalError" );558 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 559 559 } 560 560 char ntmp[1024]; … … 570 570 snprintf(conf_file,10240,"%s/%s/main.cfg",ntmp,r_inputs->value); 571 571 if(conf_read(conf_file,m)==2){ 572 errorException(NULL, _("Unable to load the main.cfg file."),"InternalError" );572 errorException(NULL, _("Unable to load the main.cfg file."),"InternalError",NULL); 573 573 free(m); 574 574 return 1; … … 654 654 r_inputs=getMap(request_inputs,"Request"); 655 655 if(request_inputs==NULL || r_inputs==NULL){ 656 errorException(m, _("Parameter <request> was not specified"),"MissingParameterValue" );656 errorException(m, _("Parameter <request> was not specified"),"MissingParameterValue","request"); 657 657 freeMaps(&m); 658 658 free(m); … … 664 664 && strncasecmp(r_inputs->value,"DescribeProcess",15)!=0 665 665 && strncasecmp(r_inputs->value,"Execute",7)!=0){ 666 errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), "InvalidParameterValue" );666 errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), "InvalidParameterValue","request"); 667 667 freeMaps(&m); 668 668 free(m); … … 674 674 r_inputs=getMap(request_inputs,"Service"); 675 675 if(r_inputs==NULLMAP){ 676 errorException(m, _("Parameter <service> was not specified"),"MissingParameterValue" );676 errorException(m, _("Parameter <service> was not specified"),"MissingParameterValue","service"); 677 677 freeMaps(&m); 678 678 free(m); 679 679 free(REQUEST); 680 680 return 1; 681 } 682 if(strncasecmp(REQUEST,"GetCapabilities",15)!=0){ 683 r_inputs=getMap(request_inputs,"Version"); 684 if(r_inputs==NULL){ 685 errorException(m, _("Parameter <version> was not specified"),"MissingParameterValue"); 681 }else{ 682 if(strcasecmp(r_inputs->value,"WPS")!=0){ 683 errorException(m, _("Unenderstood <service> value, WPS is the only acceptable value."), "InvalidParameterValue","service"); 686 684 freeMaps(&m); 687 685 free(m); … … 689 687 return 1; 690 688 } 689 } 690 if(strncasecmp(REQUEST,"GetCapabilities",15)!=0){ 691 r_inputs=getMap(request_inputs,"Version"); 692 if(r_inputs==NULL){ 693 errorException(m, _("Parameter <version> was not specified"),"MissingParameterValue","version"); 694 freeMaps(&m); 695 free(m); 696 free(REQUEST); 697 return 1; 698 }else{ 699 if(strcasecmp(r_inputs->value,"1.0.0")!=0){ 700 errorException(m, _("Unenderstood <version> value, 1.0.0 is the only acceptable value."), "InvalidParameterValue","service"); 701 freeMaps(&m); 702 free(m); 703 free(REQUEST); 704 return 1; 705 } 706 } 691 707 } 692 708 … … 726 742 DIR *dirp = opendir(conf_dir); 727 743 if(dirp==NULL){ 728 return errorException(m, _("The specified path doesn't exist."),"InvalidParameterValue" );744 return errorException(m, _("The specified path doesn't exist."),"InvalidParameterValue","metapath"); 729 745 } 730 746 xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0"); … … 748 764 s1=(service*)malloc(SERVICE_SIZE); 749 765 if(s1 == NULL){ 750 return errorException(m, _("Unable to allocate memory."),"InternalError" );766 return errorException(m, _("Unable to allocate memory."),"InternalError",NULL); 751 767 } 752 768 #ifdef DEBUG … … 779 795 if(r_inputs==NULL 780 796 || strlen(r_inputs->name)==0 || strlen(r_inputs->value)==0){ 781 errorException(m, _("Mandatory <identifier> was not specified"),"MissingParameterValue" );797 errorException(m, _("Mandatory <identifier> was not specified"),"MissingParameterValue","identifier"); 782 798 freeMaps(&m); 783 799 free(m); … … 790 806 DIR *dirp = opendir(conf_dir); 791 807 if(dirp==NULL){ 792 errorException(m, _("The specified path path doesn't exist."),"InvalidParameterValue" );808 errorException(m, _("The specified path path doesn't exist."),"InvalidParameterValue",conf_dir); 793 809 freeMaps(&m); 794 810 free(m); … … 833 849 if(s1 == NULL){ 834 850 dup2(saved_stdout,fileno(stdout)); 835 return errorException(m, _("Unable to allocate memory."),"InternalError" );851 return errorException(m, _("Unable to allocate memory."),"InternalError",NULL); 836 852 } 837 853 #ifdef DEBUG … … 863 879 else 864 880 if(strncasecmp(REQUEST,"Execute",strlen(REQUEST))!=0){ 865 errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), "InvalidParameterValue" );881 errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), "InvalidParameterValue","request"); 866 882 #ifdef DEBUG 867 883 fprintf(stderr,"No request found %s",REQUEST); … … 885 901 free(REQUEST); 886 902 free(SERVICE_URL); 887 return errorException(m, _("Unable to allocate memory."),"InternalError" );903 return errorException(m, _("Unable to allocate memory."),"InternalError",NULL); 888 904 } 889 905 r_inputs=getMap(request_inputs,"MetaPath"); … … 908 924 909 925 sprintf(tmpMsg,_("The value for <indetifier> seems to be wrong (%s). Please, ensure that the process exist using the GetCapabilities request."),r_inputs->value); 910 errorException(m, tmpMsg, "InvalidParameterValue" );926 errorException(m, tmpMsg, "InvalidParameterValue","identifier"); 911 927 free(tmpMsg); 912 928 free(s1); … … 982 998 char** outputs_as_text=(char**)malloc(128*sizeof(char*)); 983 999 if(outputs_as_text == NULL) { 984 return errorException(m, _("Unable to allocate memory"), "InternalError" );1000 return errorException(m, _("Unable to allocate memory"), "InternalError",NULL); 985 1001 } 986 1002 i=0; … … 993 1009 outputs_as_text[i]=(char*)malloc((strlen(pToken)+1)*sizeof(char)); 994 1010 if(outputs_as_text[i] == NULL) { 995 return errorException(m, _("Unable to allocate memory"), "InternalError" );1011 return errorException(m, _("Unable to allocate memory"), "InternalError",NULL); 996 1012 } 997 1013 snprintf(outputs_as_text[i],strlen(pToken)+1,"%s",pToken); … … 1010 1026 tmp_output=(maps*)malloc(MAPS_SIZE); 1011 1027 if(tmp_output == NULL){ 1012 return errorException(m, _("Unable to allocate memory."), "InternalError" );1028 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1013 1029 } 1014 1030 tmp_output->name=zStrdup(tmpc); … … 1067 1083 snprintf(cursor_input,40960,"%s",r_inputs->value); 1068 1084 else{ 1069 errorException(m, _("Parameter <DataInputs> was not specified"),"MissingParameterValue" );1085 errorException(m, _("Parameter <DataInputs> was not specified"),"MissingParameterValue","DataInputs"); 1070 1086 freeMaps(&m); 1071 1087 free(m); … … 1095 1111 char** inputs_as_text=(char**)malloc(100*sizeof(char*)); 1096 1112 if(inputs_as_text == NULL){ 1097 return errorException(m, _("Unable to allocate memory."), "InternalError" );1113 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1098 1114 } 1099 1115 i=0; … … 1109 1125 snprintf(inputs_as_text[i],strlen(pToken)+1,"%s",pToken); 1110 1126 if(inputs_as_text[i] == NULL){ 1111 return errorException(m, _("Unable to allocate memory."), "InternalError" );1127 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1112 1128 } 1113 1129 pToken = strtok(NULL,";"); … … 1141 1157 tmpmaps=(maps*)malloc(MAPS_SIZE); 1142 1158 if(tmpmaps == NULL){ 1143 return errorException(m, _("Unable to allocate memory."), "InternalError" );1159 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1144 1160 } 1145 1161 tmpmaps->name=zStrdup(tmpn); … … 1195 1211 char emsg[1024]; 1196 1212 sprintf(emsg,_("Unable to find a valid protocol to download the remote file %s"),tmpv1+1); 1197 errorException(m,emsg,"InternalError" );1213 errorException(m,emsg,"InternalError",NULL); 1198 1214 freeMaps(&m); 1199 1215 free(m); … … 1312 1328 tmpmaps=(maps*)malloc(MAPS_SIZE); 1313 1329 if(tmpmaps == NULL){ 1314 return errorException(m, _("Unable to allocate memory."), "InternalError" );1330 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1315 1331 } 1316 1332 tmpmaps->name=zStrdup((char*)val); … … 1330 1346 tmpmaps=(maps*)malloc(MAPS_SIZE); 1331 1347 if(tmpmaps == NULL){ 1332 return errorException(m, _("Unable to allocate memory."), "InternalError" );1348 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1333 1349 } 1334 1350 tmpmaps->name=zStrdup("missingIndetifier"); … … 1428 1444 has=(char*)malloc((3+strlen((char*)val)+strlen(key))*sizeof(char)); 1429 1445 if(has == NULL){ 1430 return errorException(m, _("Unable to allocate memory."), "InternalError" );1446 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1431 1447 } 1432 1448 snprintf(has,(3+strlen((char*)val)+strlen(key)),"%s: %s",key,(char*)val); … … 1478 1494 char* tmpContent = (char*)malloc((res.nDataLen+1)*sizeof(char)); 1479 1495 if(tmpContent == NULL){ 1480 return errorException(m, _("Unable to allocate memory."), "InternalError" );1496 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1481 1497 } 1482 1498 size_t dwRead; … … 1513 1529 (char*)malloc((res1.nDataLen+1)*sizeof(char)); 1514 1530 if(tmp == NULL){ 1515 return errorException(m, _("Unable to allocate memory."), "InternalError" );1531 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1516 1532 } 1517 1533 size_t bRead; … … 1531 1547 char* tmpContent = (char*)malloc((res.nDataLen+1)*sizeof(char)); 1532 1548 if(tmpContent == NULL){ 1533 return errorException(m, _("Unable to allocate memory."), "InternalError" );1549 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1534 1550 } 1535 1551 size_t dwRead; … … 1750 1766 tmpmaps=(maps*)malloc(MAPS_SIZE); 1751 1767 if(tmpmaps == NULL){ 1752 return errorException(m, _("Unable to allocate memory."), "InternalError" );1768 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1753 1769 } 1754 1770 tmpmaps->name=zStrdup("unknownIdentifier"); … … 1792 1808 tmpmaps=(maps*)malloc(MAPS_SIZE); 1793 1809 if(tmpmaps == NULL){ 1794 return errorException(m, _("Unable to allocate memory."), "InternalError" );1810 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1795 1811 } 1796 1812 tmpmaps->name=zStrdup((char*)val); … … 1829 1845 tmpmaps=(maps*)malloc(MAPS_SIZE); 1830 1846 if(tmpmaps == NULL){ 1831 return errorException(m, _("Unable to allocate memory."), "InternalError" );1847 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1832 1848 } 1833 1849 tmpmaps->name=zStrdup("missingIndetifier"); … … 1878 1894 tmpmaps=(maps*)malloc(MAPS_SIZE); 1879 1895 if(tmpmaps == NULL){ 1880 return errorException(m, _("Unable to allocate memory."), "InternalError" );1896 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1881 1897 } 1882 1898 tmpmaps->name=zStrdup((char*)val); … … 1901 1917 tmpmaps=(maps*)malloc(MAPS_SIZE); 1902 1918 if(tmpmaps == NULL){ 1903 return errorException(m, _("Unable to allocate memory."), "InternalError" );1919 return errorException(m, _("Unable to allocate memory."), "InternalError",NULL); 1904 1920 } 1905 1921 tmpmaps->name=zStrdup("missingIndetifier"); … … 1963 1979 if(strcmp(dfv1,"")!=0 || strcmp(dfv,"")!=0){ 1964 1980 char tmps[1024]; 1981 map* tmpe=createMap("code","MissingParameterValue"); 1965 1982 if(strcmp(dfv,"")!=0){ 1966 1983 snprintf(tmps,1024,_("The <%s> argument was not specified in DataInputs but defined as requested in ZOO ServicesProvider configuration file, please correct your query or the ZOO Configuration file."),dfv); 1984 addToMap(tmpe,"locator",dfv); 1967 1985 } 1968 1986 else if(strcmp(dfv1,"")!=0){ 1969 1987 snprintf(tmps,1024,_("The <%s> argument was specified as Output identifier but not defined in the ZOO Configuration File. Please, correct your query or the ZOO Configuration File."),dfv1); 1970 }1971 map* tmpe=createMap("text",tmps);1972 addToMap(tmpe," code","MissingParameterValue");1988 addToMap(tmpe,"locator",dfv1); 1989 } 1990 addToMap(tmpe,"text",tmps); 1973 1991 printExceptionReportResponse(m,tmpe); 1974 1992 freeService(&s1); … … 2116 2134 if(status!=NULL && strcmp(status->value,"true")==0 && 2117 2135 store!=NULL && strcmp(store->value,"false")==0){ 2118 errorException(m, _("Status cannot be set to true with storeExecuteResponse to false. Please, modify your request parameters."), "InvalidParameterValue" );2136 errorException(m, _("Status cannot be set to true with storeExecuteResponse to false. Please, modify your request parameters."), "InvalidParameterValue","storeExecuteResponse"); 2119 2137 freeService(&s1); 2120 2138 free(s1); … … 2329 2347 */ 2330 2348 eres=-1; 2331 errorException(m, _("Unable to run the child process properly"), "InternalError" );2349 errorException(m, _("Unable to run the child process properly"), "InternalError",NULL); 2332 2350 } 2333 2351 }
Note: See TracChangeset
for help on using the changeset viewer.