Ignore:
Timestamp:
Sep 8, 2020, 4:51:09 PM (21 months ago)
Author:
djay
Message:

Make sure not to try accessing mimetype and provenance in case a local file is used. Fix issue with addMapsToMaps. Produce value string only when memory=load for Python support. Make gdal/profile service usable in case memory=protect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/caching.c

    r955 r961  
    403403  if(strncasecmp(request,"file://",7)==0){
    404404    char* tmpStr=zStrdup(request+7);
    405     fprintf(stderr,"**** %s %d %s \n",__FILE__,__LINE__,tmpStr);
     405    setMapInMaps(conf,"lenv",tmpStr,"local");
    406406    return tmpStr;
    407407  }
     
    709709      unlockFile(*m,lck);
    710710    }
    711     cached[strlen(cached)-1]='m';
    712     s=zStat(cached, &f_status);
    713     if(s==0){
    714       zooLock* lck=lockFile(*m,cached,'r');
    715       if(lck==NULL)
    716         return -1;
    717       mimeType=(char*)malloc(sizeof(char)*(f_status.st_size+1));
    718       FILE* f=fopen(cached,"rb");
    719       fread(mimeType,f_status.st_size,1,f);
    720       mimeType[f_status.st_size]=0;
    721       fclose(f);
    722       unlockFile(*m,lck);
    723     }
    724     cached[strlen(cached)-1]='p';
    725     s=zStat(cached, &f_status);
    726     if(s==0){
    727       zooLock* lck=lockFile(*m,cached,'r');
    728       if(lck==NULL)
    729         return -1;
    730       origin=(char*)malloc(sizeof(char)*(f_status.st_size+1));
    731       FILE* f=fopen(cached,"rb");
    732       fread(origin,f_status.st_size,1,f);
    733       mimeType[f_status.st_size]=0;
    734       fclose(f);
    735       unlockFile(*m,lck);
    736     }
     711    map* isLocalFile=getMapFromMaps(*m,"lenv",cached);
     712    if(isLocalFile==NULL){
     713      cached[strlen(cached)-1]='m';
     714      s=zStat(cached, &f_status);
     715      if(s==0){
     716        zooLock* lck=lockFile(*m,cached,'r');
     717        if(lck==NULL)
     718          return -1;
     719        mimeType=(char*)malloc(sizeof(char)*(f_status.st_size+1));
     720        FILE* f=fopen(cached,"rb");
     721        fread(mimeType,f_status.st_size,1,f);
     722        mimeType[f_status.st_size]=0;
     723        fclose(f);
     724        unlockFile(*m,lck);
     725      }
     726      cached[strlen(cached)-1]='p';
     727      s=zStat(cached, &f_status);
     728      if(s==0){
     729        zooLock* lck=lockFile(*m,cached,'r');
     730        if(lck==NULL)
     731          return -1;
     732        origin=(char*)malloc(sizeof(char)*(f_status.st_size+1));
     733        FILE* f=fopen(cached,"rb");
     734        fread(origin,f_status.st_size,1,f);
     735        mimeType[f_status.st_size]=0;
     736        fclose(f);
     737        unlockFile(*m,lck);
     738      }
     739    }   
    737740  }else{   
    738741    addRequestToQueue(m,hInternet,url,true);
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