- Timestamp:
- Jul 27, 2011, 3:26:01 AM (13 years ago)
- Location:
- trunk/zoo-kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/service.h
r281 r282 498 498 } 499 499 500 static map* getMapOr Empty(map* m,const char *key){500 static map* getMapOrFill(map* m,const char *key,char* value){ 501 501 map* tmp=m; 502 502 map* tmpMap=getMap(tmp,key); 503 503 if(tmpMap==NULL){ 504 addToMap(tmp,key, "");504 addToMap(tmp,key,value); 505 505 tmpMap=getMap(tmp,key); 506 506 } -
trunk/zoo-kernel/service_internal.c
r281 r282 2384 2384 int fsize; 2385 2385 if(cached!=NULL){ 2386 fprintf(stderr,"Use cached file: %s\n",cached);2387 2386 struct stat f_status; 2388 2387 int s=stat(cached, &f_status); 2389 2388 if(s==0){ 2390 fprintf(stderr,"Use cached file: %s\n",cached);2391 2389 fcontent=(char*)malloc(sizeof(char)*(f_status.st_size+1)); 2392 2390 FILE* f=fopen(cached,"r"); … … 2405 2403 fsize=res.nDataLen; 2406 2404 } 2407 map* tmpMap=getMapOr Empty(content,"value");2405 map* tmpMap=getMapOrFill(content,"value",""); 2408 2406 free(tmpMap->value); 2409 2407 tmpMap->value=(char*)malloc((fsize+1)*sizeof(char)); -
trunk/zoo-kernel/zoo_service_loader.c
r281 r282 452 452 _getcwd(ntmp,1024); 453 453 #endif 454 r_inputs=getMap(request_inputs,"metapath"); 455 if(r_inputs==NULL){ 456 if(request_inputs==NULL) 457 request_inputs=createMap("metapath",""); 458 else 459 addToMap(request_inputs,"metapath",""); 460 #ifdef DEBUG 461 fprintf(stderr,"ADD METAPATH\n"); 462 dumpMap(request_inputs); 463 #endif 464 r_inputs=getMap(request_inputs,"metapath"); 465 } 454 r_inputs=getMapOrFill(request_inputs,"metapath",""); 455 466 456 char conf_file[10240]; 467 457 snprintf(conf_file,10240,"%s/%s/main.cfg",ntmp,r_inputs->value); … … 1399 1389 * mimeType, encoding, schema 1400 1390 */ 1401 const char *coms[3]; 1402 coms[0]="mimeType"; 1403 coms[1]="encoding"; 1404 coms[2]="schema"; 1391 const char *coms[3]={"mimeType","encoding","schema"}; 1405 1392 for(int l=0;l<3;l++){ 1406 1393 #ifdef DEBUG … … 1433 1420 xmlChar* mv=xmlNodeListGetString(doc,cur4->xmlChildrenNode,1); 1434 1421 map* ltmp=getMap(tmpmaps->content,"mimeType"); 1422 dumpMap(ltmp); 1435 1423 if(mv==NULL || 1436 1424 (xmlStrcasecmp(cur4->name, BAD_CAST "ComplexData")==0 &&
Note: See TracChangeset
for help on using the changeset viewer.