- Timestamp:
- Mar 7, 2018, 11:37:36 AM (7 years ago)
- Location:
- branches/prototype-v0/zoo-project/zoo-kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/caching.c
r865 r872 289 289 map* tmpM=getMapFromMaps(conf,"main","cacheDir"); 290 290 if(tmpM!=NULL){ 291 char* myRequest=getFilenameForRequest(conf,request); 292 char* md5str=getMd5(myRequest); 293 free(myRequest); 294 #ifdef DEBUG 295 fprintf(stderr,"MD5STR : (%s)\n\n",md5str); 296 #endif 297 char* fname=(char*)malloc(sizeof(char)*(strlen(tmpM->value)+strlen(md5str)+6)); 298 sprintf(fname,"%s/%s.zca",tmpM->value,md5str); 299 struct stat f_status; 300 int s=stat(fname, &f_status); 301 if(s==0 && f_status.st_size>0){ 291 if(strncasecmp(request,"file://",7)==0){ 292 char* tmpStr=zStrdup(request+7); 293 fprintf(stderr,"**** %s %d %s \n",__FILE__,__LINE__,tmpStr); 294 return tmpStr; 295 } 296 else{ 297 298 char* myRequest=getFilenameForRequest(conf,request); 299 char* md5str=getMd5(myRequest); 300 free(myRequest); 301 #ifdef DEBUG 302 fprintf(stderr,"MD5STR : (%s)\n\n",md5str); 303 #endif 304 char* fname=(char*)malloc(sizeof(char)*(strlen(tmpM->value)+strlen(md5str)+6)); 305 sprintf(fname,"%s/%s.zca",tmpM->value,md5str); 306 struct stat f_status; 307 int s=stat(fname, &f_status); 308 if(s==0 && f_status.st_size>0){ 309 free(md5str); 310 return fname; 311 } 302 312 free(md5str); 303 return fname; 304 } 305 free(md5str); 306 free(fname); 313 free(fname); 314 } 307 315 } 308 316 return NULL; … … 632 640 if(tmp!=NULL){ 633 641 map *c=getMap((*content),"xlink:href"); 634 char *myRequest=getFilenameForRequest(*m,c->value); 635 char* md5str=getMd5(myRequest); 636 free(myRequest); 637 char* fname=(char*)malloc(sizeof(char)*(strlen(tmp->value)+strlen(md5str)+6)); 638 sprintf(fname,"%s/%s.zca",tmp->value,md5str); 639 addToMap(*content,"cache_file",fname); 640 free(fname); 641 free(md5str); 642 if(strncasecmp(c->value,"file://",7)!=0){ 643 char *myRequest=getFilenameForRequest(*m,c->value); 644 char* md5str=getMd5(myRequest); 645 free(myRequest); 646 char* fname=(char*)malloc(sizeof(char)*(strlen(tmp->value)+strlen(md5str)+6)); 647 sprintf(fname,"%s/%s.zca",tmp->value,md5str); 648 addToMap(*content,"cache_file",fname); 649 free(fname); 650 free(md5str); 651 } 642 652 } 643 653 } -
branches/prototype-v0/zoo-project/zoo-kernel/response_print.c
r867 r872 2634 2634 map* _tmp2=getMapArray(tmps->content,"ecookie",cnt); 2635 2635 if(_tmp2!=NULL) 2636 printf("Set-Cookie: %s; HttpOnly\r\n",_tmp ->value);2636 printf("Set-Cookie: %s; HttpOnly\r\n",_tmp2->value); 2637 2637 } 2638 2638 }
Note: See TracChangeset
for help on using the changeset viewer.