Changeset 364 for trunk/zoo-project/zoo-kernel/service_internal.c
- Timestamp:
- Sep 29, 2012, 3:59:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal.c
r360 r364 24 24 25 25 #include "service_internal.h" 26 27 #ifdef WIN32 28 char * 29 strtok_r (char *s1, const char *s2, char **lasts) 30 { 31 char *ret; 32 if (s1 == NULL) 33 s1 = *lasts; 34 while (*s1 && strchr(s2, *s1)) 35 ++s1; 36 if (*s1 == '\0') 37 return NULL; 38 ret = s1; 39 while (*s1 && !strchr(s2, *s1)) 40 ++s1; 41 if (*s1) 42 *s1++ = '\0'; 43 *lasts = s1; 44 return ret; 45 } 26 #ifdef USE_MS 27 #include "service_internal_ms.h" 46 28 #endif 47 29 … … 1215 1197 } 1216 1198 1217 1199 1218 1200 1219 1201 xmlNewProp(n,BAD_CAST "serviceInstance",BAD_CAST tmp); … … 1232 1214 1233 1215 printDescription(nc,ns_ows,serv->name,serv->content); 1234 fflush(stderr);1216 //fflush(stderr); 1235 1217 1236 1218 xmlAddChild(n,nc); … … 1353 1335 xmlAddChild(n,nc); 1354 1336 } 1337 1355 1338 #ifdef DEBUG 1356 1339 fprintf(stderr,"printProcessResponse 1 202\n"); … … 1481 1464 xmlAddChild(nc,nc1); 1482 1465 // Extract Title required to be first element in the ZCFG file ! 1483 bool isTitle= true;1466 bool isTitle=TRUE; 1484 1467 if(e!=NULL) 1485 1468 tmp=getMap(e->content,"Title"); … … 1625 1608 strncmp(tmp2->value,"application/vnd.google-earth.kml",32)==0){ 1626 1609 xmlDocPtr doc = 1627 xmlParseMemory( BAD_CAST toto->value,strlen(BAD_CASTtoto->value));1610 xmlParseMemory(toto->value,strlen(toto->value)); 1628 1611 xmlNodePtr ir = xmlDocGetRootElement(doc); 1629 1612 xmlAddChild(nc3,ir); … … 1634 1617 xmlAddChild(nc2,nc3); 1635 1618 } 1636 else 1637 xmlAddChild(nc3,xmlNewText(BAD_CAST toto->value)); 1619 else{ 1620 xmlAddChild(nc3,xmlNewText(BAD_CAST toto->value)); 1621 } 1638 1622 } 1639 1623 } … … 1667 1651 } 1668 1652 } 1669 1670 1653 xmlAddChild(nc1,nc2); 1671 1654 xmlAddChild(nc,nc1); … … 1826 1809 } 1827 1810 } 1811 1828 1812 if(asRaw==0){ 1829 1813 #ifdef DEBUG … … 1834 1818 while(tmpI!=NULL){ 1835 1819 #ifdef USE_MS 1836 map* testMap=getMap(tmpI->content,"useMapserver"); 1820 map* testMap=getMap(tmpI->content,"useMapserver"); 1837 1821 #endif 1838 1822 toto=getMap(tmpI->content,"asReference"); … … 2204 2188 char *tcn=strdup(tmpContent->name); 2205 2189 for(i=1;i<atoi(length->value);i++){ 2190 #ifdef DEBUG 2206 2191 dumpMap(tmpMaps->content); 2207 2192 fprintf(stderr,"addDefaultValues %s_%d => %s\n",tcn,i,tmpContent->value); 2208 int len=strlen(tcn); 2209 char *tmp1=malloc((len+10)*sizeof(char)); 2193 #endif 2194 int len=strlen((char*) tcn); 2195 char *tmp1=(char *)malloc((len+10)*sizeof(char)); 2210 2196 sprintf(tmp1,"%s_%d",tcn,i); 2197 #ifdef DEBUG 2211 2198 fprintf(stderr,"addDefaultValues %s => %s\n",tmp1,tmpContent->value); 2199 #endif 2212 2200 addToMap(tmpMaps->content,tmp1,tmpContent->value); 2213 2201 free(tmp1); … … 2406 2394 2407 2395 2408 unsignedchar* getMd5(char* url){2396 char* getMd5(char* url){ 2409 2397 EVP_MD_CTX md5ctx; 2410 unsignedchar* fresult=(char*)malloc((EVP_MAX_MD_SIZE+1)*sizeof(char));2398 char* fresult=(char*)malloc((EVP_MAX_MD_SIZE+1)*sizeof(char)); 2411 2399 unsigned char result[EVP_MAX_MD_SIZE]; 2412 2400 unsigned int len; … … 2434 2422 map* tmp=getMapFromMaps(conf,"main","cacheDir"); 2435 2423 if(tmp!=NULL){ 2436 unsignedchar* md5str=getMd5(request);2424 char* md5str=getMd5(request); 2437 2425 char* fname=(char*)malloc(sizeof(char)*(strlen(tmp->value)+strlen(md5str)+6)); 2438 2426 sprintf(fname,"%s/%s.zca",tmp->value,md5str); … … 2452 2440 map* tmpM=getMapFromMaps(conf,"main","cacheDir"); 2453 2441 if(tmpM!=NULL){ 2454 unsignedchar* md5str=getMd5(request);2442 char* md5str=getMd5(request); 2455 2443 #ifdef DEBUG 2456 2444 fprintf(stderr,"MD5STR : (%s)\n\n",md5str); … … 2474 2462 * Try to load file from cache or download a remote file if not in cache 2475 2463 */ 2476 voidloadRemoteFile(maps* m,map* content,HINTERNET hInternet,char *url){2464 int loadRemoteFile(maps* m,map* content,HINTERNET hInternet,char *url){ 2477 2465 HINTERNET res; 2478 2466 char* fcontent; … … 2516 2504 free(fcontent); 2517 2505 free(cached); 2506 return 0; 2518 2507 } 2519 2508
Note: See TracChangeset
for help on using the changeset viewer.