- Timestamp:
- Aug 29, 2017, 10:52:39 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/service_callback.c
r846 r850 35 35 #endif 36 36 37 /** 38 * Check if a service name is prohibited, meaning that we don't have to invoke 39 * the callback for this specific service. 40 * 41 */ 42 bool isProhibited(maps* conf,const char* serviceName){ 43 map* plist=getMapFromMaps(conf,"callback","prohibited"); 44 if(plist!=NULL){ 45 char *tmp=plist->value; 46 char *tmpS=strtok(tmp,","); 47 while(tmpS!=NULL){ 48 if(strcmp(serviceName,tmpS)==0) 49 return true; 50 tmpS=strtok(NULL,","); 51 } 52 } 53 return false; 54 } 55 37 56 /** 38 57 * Invoke the callback in case there is a [callback] section containing a url parameter … … 57 76 if(url==NULL) 58 77 return false; 59 78 60 79 maps* lenv=getMaps(m,"lenv"); 61 80 map* sname=getMap(lenv->content,"identifier"); 81 if(sname!=NULL && isProhibited(m,sname->value)) 82 return false; 83 62 84 json_object *res=json_object_new_object(); 63 85 … … 87 109 maps* curs=inputs; 88 110 89 char *keys[ 4][2]={111 char *keys[8][2]={ 90 112 { 91 113 "href", … … 103 125 "size", 104 126 "size" 105 } 127 }, 128 { 129 "ref_wms_link", 130 "ref_wms_link" 131 }, 132 { 133 "ref_wcs_link", 134 "ref_wcs_link" 135 }, 136 { 137 "ref_wfs_link", 138 "ref_wfs_link" 139 }, 140 { 141 "datatype", 142 "datatype" 143 } 106 144 }; 107 145 json_object *res1=json_object_new_object(); 108 146 while(curs!=NULL){ 109 147 map* tmpMap=getMap(curs->content,"cache_file"); 110 if(tmpMap!=NULL){ 148 sid=getMap(curs->content,"ref_wms_link"); 149 if(tmpMap!=NULL && sid==NULL){ 111 150 addToMap(curs->content,"generated_file",tmpMap->value); 112 151 tmpMap=getMap(curs->content,"fmimeType"); … … 121 160 int i=0; 122 161 int hasRef=-1; 123 for(;i< 4;i++){162 for(;i<8;i++){ 124 163 sid=getMap(curs->content,keys[i][0]); 125 164 if(sid!=NULL){
Note: See TracChangeset
for help on using the changeset viewer.