- Timestamp:
- Sep 17, 2014, 8:49:47 PM (10 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal.c
r500 r501 36 36 #define FALSE -1 37 37 #endif 38 39 int isValidLang(maps* conf,const char *str){ 40 map *tmpMap=getMapFromMaps(conf,"main","lang"); 41 char *tmp=zStrdup(tmpMap->value); 42 char *pToken=strtok(tmp,","); 43 int res=-1; 44 while(pToken!=NULL){ 45 if(strcasecmp(str,pToken)==0){ 46 res=1; 47 break; 48 } 49 pToken = strtok(NULL,","); 50 } 51 free(tmp); 52 return res; 53 } 38 54 39 55 void printHeaders(maps* m){ -
trunk/zoo-project/zoo-kernel/service_internal.h
r492 r501 94 94 int getServiceFromYAML(maps*,char*,service**,char *name); 95 95 int readServiceFile(maps*, char*,service**,char *); 96 96 int isValidLang(maps*,const char*); 97 97 98 98 void printHeaders(maps*); -
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r498 r501 732 732 r_inputs=getMapFromMaps(m,"main","language"); 733 733 if(r_inputs!=NULL){ 734 if(isValidLang(m,r_inputs->value)<0){ 735 char tmp[1024]; 736 sprintf(tmp,_("The value %s is not supported for the <language> parameter"), 737 r_inputs->value); 738 errorException(m, tmp,"InvalidParameterValue","language"); 739 freeMaps(&m); 740 free(m); 741 free(REQUEST); 742 return 1; 743 744 } 734 745 char *tmp=zStrdup(r_inputs->value); 735 746 setMapInMaps(m,"main","language",tmp); … … 777 788 if(strlen(cgiServerName)>0){ 778 789 char tmpUrl[1024]; 779 sprintf(tmpUrl,"http://%s%s",cgiServerName,cgiScriptName); 790 if(strncmp(cgiServerPort,"80",2)==0){ 791 sprintf(tmpUrl,"http://%s%s",cgiServerName,cgiScriptName); 792 }else{ 793 sprintf(tmpUrl,"http://%s:%s%s",cgiServerName,cgiServerPort,cgiScriptName); 794 } 780 795 #ifdef DEBUG 781 796 fprintf(stderr,"*** %s ***\n",tmpUrl); … … 803 818 && strncasecmp(r_inputs->value,"DescribeProcess",15)!=0 804 819 && strncasecmp(r_inputs->value,"Execute",7)!=0){ 805 errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), " InvalidParameterValue","request");820 errorException(m, _("Unenderstood <request> value. Please check that it was set to GetCapabilities, DescribeProcess or Execute."), "OperationNotSupported",r_inputs->value); 806 821 freeMaps(&m); 807 822 free(m); … … 844 859 } 845 860 } 861 }else{ 862 r_inputs=getMap(request_inputs,"AcceptVersions"); 863 if(r_inputs!=NULL){ 864 if(strncmp(r_inputs->value,"1.0.0",5)!=0){ 865 errorException(m, _("Unenderstood <AcceptVersions> value, 1.0.0 is the only acceptable value."), "VersionNegotiationFailed",NULL); 866 freeMaps(&m); 867 free(m); 868 free(REQUEST); 869 return 1; 870 } 871 } 846 872 } 847 873
Note: See TracChangeset
for help on using the changeset viewer.