Changeset 360 for trunk/zoo-project/zoo-kernel/zoo_service_loader.c
- Timestamp:
- Jun 7, 2012, 10:54:31 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/zoo_service_loader.c
r348 r360 2 2 * Author : Gérald FENOY 3 3 * 4 * Copyright 2008-201 1GeoLabs SARL. All rights reserved.4 * Copyright 2008-2012 GeoLabs SARL. All rights reserved. 5 5 * 6 6 * Permission is hereby granted, free of charge, to any person obtaining a copy … … 92 92 str[i]=toReplaceBy; 93 93 } 94 } 95 96 /** 97 * Create (or append to) an array valued maps 98 * value = "["",""]" 99 */ 100 int appendMapsToMaps(maps* m,maps* mo,maps* mi,elements* elem){ 101 102 map* tmap=getMapType(mo->content); 103 if(tmap==NULL){ 104 tmap=getMapType(elem->defaults->content); 105 } 106 107 map* testMap=getMap(elem->content,"maxOccurs"); 108 if(testMap!=NULL){ 109 if(strncasecmp(testMap->value,"unbounded",9)!=0 && atoi(testMap->value)>1){ 110 if(addMapsArrayToMaps(&mo,mi,tmap->name)<0){ 111 char emsg[1024]; 112 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)); 113 errorException(m,emsg,"InternalError"); 114 return -1; 115 } 116 }else{ 117 if(strncasecmp(testMap->value,"unbounded",9)==0){ 118 if(addMapsArrayToMaps(&mo,mi,tmap->name)<0){ 119 char emsg[1024]; 120 map* tmpMap=getMap(mi->content,"length"); 121 sprintf(emsg,_("ZOO-Kernel was unable to load your data for %s position %s."),mi->name,tmpMap->value); 122 errorException(m,emsg,"InternalError"); 123 return -1; 124 } 125 } 126 else{ 127 char emsg[1024]; 128 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); 129 errorException(m,emsg,"InternalError"); 130 return -1; 131 } 132 } 133 } 134 return 0; 94 135 } 95 136 … … 1068 1109 if(request_input_real_format==NULL) 1069 1110 request_input_real_format=dupMaps(&tmpmaps); 1070 else 1071 addMapsToMaps(&request_input_real_format,tmpmaps); 1111 else{ 1112 maps* testPresence=getMaps(request_input_real_format,tmpmaps->name); 1113 if(testPresence!=NULL){ 1114 elements* elem=getElements(s1->inputs,tmpmaps->name); 1115 if(elem!=NULL){ 1116 if(appendMapsToMaps(m,request_input_real_format,tmpmaps,elem)<0){ 1117 freeMaps(&m); 1118 free(m); 1119 free(REQUEST); 1120 free(SERVICE_URL); 1121 InternetCloseHandle(hInternet); 1122 freeService(&s1); 1123 free(s1); 1124 return 0; 1125 } 1126 } 1127 } 1128 else 1129 addMapsToMaps(&request_input_real_format,tmpmaps); 1130 } 1072 1131 freeMaps(&tmpmaps); 1073 1132 free(tmpmaps); … … 1479 1538 fflush(stderr); 1480 1539 #endif 1481 addMapsToMaps(&request_input_real_format,tmpmaps); 1540 1541 { 1542 maps* testPresence=getMaps(request_input_real_format,tmpmaps->name); 1543 if(testPresence!=NULL){ 1544 elements* elem=getElements(s1->inputs,tmpmaps->name); 1545 if(elem!=NULL){ 1546 if(appendMapsToMaps(m,request_input_real_format,tmpmaps,elem)<0){ 1547 freeMaps(&m); 1548 free(m); 1549 free(REQUEST); 1550 free(SERVICE_URL); 1551 InternetCloseHandle(hInternet); 1552 freeService(&s1); 1553 free(s1); 1554 return 0; 1555 } 1556 } 1557 } 1558 else 1559 addMapsToMaps(&request_input_real_format,tmpmaps); 1560 } 1482 1561 1483 1562 #ifdef DEBUG
Note: See TracChangeset
for help on using the changeset viewer.