Changeset 632


Ignore:
Timestamp:
Apr 14, 2015, 1:23:07 AM (9 years ago)
Author:
djay
Message:

Make sure to rename the cached zip file only when its name contains ".zca".

File:
1 edited

Legend:

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

    r631 r632  
    272272                    if(tmpVal!=NULL){
    273273                      if(strncasecmp(tmpVal->value,"application/zip",14)==0){
    274                         char tmpName[1024];
    275                         symlink(test->value,ReplaceAll(test->value,".zca",".zip").c_str());
    276                         sprintf(tmpName,"/vsizip/%s",ReplaceAll(test->value,".zca",".zip").c_str());
     274                        char *tmpName=(char*)malloc((strlen(test->value)+9)*sizeof(char));
     275                        std::string test0(test->value);
     276                        if(test0.find(".zca")!=std::string::npos){
     277                          symlink(test->value,ReplaceAll(test->value,".zca",".zip").c_str());
     278                          sprintf(tmpName,"/vsizip/%s",ReplaceAll(test->value,".zca",".zip").c_str());
     279                        }else
     280                          sprintf(tmpName,"/vsizip/%s",test->value);
    277281                        char **files=VSIReadDir(tmpName);
    278282                        int nFiles = CSLCount( files );
    279                         char tmpSSName[1024];
    280                         sprintf(tmpSSName,"%s/Input_%s_%s",tmpPath->value,s->name,tmpSid->value);
     283                        char *tmpSSName=(char*)malloc((strlen(tmpPath->value)+strlen(paramKey.c_str())+strlen(tmpSid->value)+9)*sizeof(char));
     284                        sprintf(tmpSSName,"%s/Input_%s_%s",tmpPath->value,paramKey.c_str(),tmpSid->value);
    281285                        mkdir(tmpSSName,0777);
    282286                           
    283                         char tmpSName[1024];
    284287                        for(int kk=0;kk<nFiles;kk++){
     288                          char *tmpSName=(char*)malloc((strlen(tmpName)+strlen(files[kk])+2)*sizeof(char));
    285289                          sprintf(tmpSName,"%s/%s",tmpName,files[kk]);
    286290                          VSILFILE* fmain=VSIFOpenL(tmpSName, "rb");
     
    293297                            VSIFReadL(content,1,count*sizeof(char),fmain);
    294298                         
    295                             char tmpSSSName[1024];
     299                            char *tmpSSSName=(char*)malloc((strlen(tmpSSName)+strlen(files[kk])+2)*sizeof(char));
    296300                            sprintf(tmpSSSName,"%s/%s",tmpSSName,files[kk]);
    297301                           
     
    306310                              test=getMapFromMaps(inputs,paramKey.c_str(),"cache_file");
    307311                            }
     312                            free(tmpSSSName);
    308313                          }
     314                          free(tmpSName);
    309315                        }
     316                        free(tmpSSName);
     317                        free(tmpName);
    310318                      }
    311319                    }
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