Changeset 872 for branches


Ignore:
Timestamp:
Mar 7, 2018, 11:37:36 AM (6 years ago)
Author:
djay
Message:

Fix name of the map red to return extra cookie headers

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  
    289289  map* tmpM=getMapFromMaps(conf,"main","cacheDir");
    290290  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      }
    302312      free(md5str);
    303       return fname;
    304     }
    305     free(md5str);
    306     free(fname);
     313      free(fname);
     314    }
    307315  }
    308316  return NULL;
     
    632640    if(tmp!=NULL){
    633641      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      }
    642652    }
    643653  }
  • branches/prototype-v0/zoo-project/zoo-kernel/response_print.c

    r867 r872  
    26342634          map* _tmp2=getMapArray(tmps->content,"ecookie",cnt);
    26352635          if(_tmp2!=NULL)
    2636             printf("Set-Cookie: %s; HttpOnly\r\n",_tmp->value);
     2636            printf("Set-Cookie: %s; HttpOnly\r\n",_tmp2->value);
    26372637        }
    26382638      }
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png