Changeset 822 for branches/prototype-v0/zoo-project/zoo-kernel/caching.c
- Timestamp:
- May 3, 2017, 12:53:06 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/caching.c
r817 r822 178 178 char icname[14]; 179 179 char xname[16]; 180 char bname[8]; 181 char hname[11]; 180 182 char oname[12]; 181 183 if(*index>0) … … 192 194 sprintf(icname,"isCached_%d",i); 193 195 sprintf(xname,"Reference_%d",i); 196 sprintf(bname,"body_%d",i); 197 sprintf(hname,"headers_%d",i); 194 198 sprintf(oname,"Order_%d",i); 195 199 }else{ … … 200 204 sprintf(icname,"isCached"); 201 205 sprintf(xname,"Reference"); 206 sprintf(bname,"body"); 207 sprintf(hname,"headers",i); 202 208 sprintf(oname,"Order"); 203 209 } … … 255 261 sprintf(ltmp1,"%d",fsize); 256 262 map* tmp=getMapFromMaps(*m,"main","cacheDir"); 263 char *request=NULL; 257 264 if(tmp!=NULL){ 258 char* md5str=getMd5(tmp1->value); 265 map* tmp2; 266 char* md5str=NULL; 267 if((tmp2=getMap(content->content,bname))!=NULL){ 268 dumpMap(tmp2); 269 char *tmpStr=(char*)malloc((strlen(tmp1->value)+strlen(tmp2->value)+1)*sizeof(char)); 270 sprintf(tmpStr,"%s%s",tmp1->value,tmp2->value); 271 if((tmp2=getMap(content->content,"headers"))!=NULL){ 272 char *tmpStr2=zStrdup(tmpStr); 273 tmpStr=(char*)malloc((strlen(tmpStr2)+strlen(tmp2->value)+1)*sizeof(char)); 274 sprintf(tmpStr,"%s%s",tmpStr2,tmp2->value); 275 free(tmpStr2); 276 } 277 md5str=getMd5(tmpStr); 278 request=zStrdup(tmpStr); 279 free(tmpStr); 280 }else{ 281 md5str=getMd5(tmp1->value); 282 request=zStrdup(tmp1->value); 283 } 259 284 char* fname=(char*)malloc(sizeof(char)*(strlen(tmp->value)+strlen(md5str)+6)); 260 285 sprintf(fname,"%s/%s.zca",tmp->value,md5str); … … 264 289 addToMap((*in)->content,sname,ltmp1); 265 290 addToMap((*in)->content,mname,mimeType); 266 addToCache(*m, tmp1->value,fcontent,mimeType,fsize, NULL, 0);291 addToCache(*m,request,fcontent,mimeType,fsize, NULL, 0); 267 292 free(fcontent); 268 293 free(mimeType); 294 free(request); 269 295 *index++; 270 296
Note: See TracChangeset
for help on using the changeset viewer.