Changeset 378 for trunk/zoo-project


Ignore:
Timestamp:
Nov 4, 2012, 3:43:29 PM (11 years ago)
Author:
djay
Message:

Directly use tmpUrl if it starts with "http://". Fix cache system. Add support for "%" in main.cfg to let user define printf format for instance.

Location:
trunk/zoo-project/zoo-kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/main_conf_read.l

    r364 r378  
    3131attname [a-zA-Z0-9_\-:]+
    3232
    33 attvalue1       [\*,;@a-zA-Z0-9_\-.:" "\"\'/\\\(\)\+\x41-\xff]+
     33attvalue1       [%\*,;@a-zA-Z0-9_\-.:" "\"\'/\\\(\)\+\x41-\xff]+
    3434
    3535attvalue                \"[^"]*\"|\'[^']*\'
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r375 r378  
    12061206      map* tmpm2=getMap(tmp_maps->content,"tmpUrl");
    12071207      if(tmpm1!=NULL && tmpm2!=NULL){
    1208         sprintf(url,"%s/%s/%s_%i.xml",tmpm1->value,tmpm2->value,service,pid);
     1208        if(strncasecmp(tmpm2->value,"http://",7)==0){
     1209          sprintf(url,"%s/%s_%i.xml",tmpm2->value,service,pid);
     1210        }else
     1211          sprintf(url,"%s/%s/%s_%i.xml",tmpm1->value,tmpm2->value,service,pid);
    12091212      }
    12101213    }
     
    18921895        map *tmp3=getMapFromMaps(m,"main","serverAddress");
    18931896        char *file_url;
    1894         file_url=(char*)malloc((strlen(tmp3->value)+strlen(tmp2->value)+strlen(s->name)+strlen(ext->value)+strlen(tmpI->name)+13)*sizeof(char));
    1895         sprintf(file_url,"%s/%s/%s_%s_%i.%s",tmp3->value,tmp2->value,s->name,tmpI->name,cpid+100000,ext->value);
     1897        if(strncasecmp(tmp2->value,"http://",7)==0){
     1898          file_url=(char*)malloc((strlen(tmp2->value)+strlen(s->name)+strlen(ext->value)+strlen(tmpI->name)+13)*sizeof(char));
     1899          sprintf(file_url,"%s/%s_%s_%i.%s",tmp2->value,s->name,tmpI->name,cpid+100000,ext->value);
     1900        }else{
     1901          file_url=(char*)malloc((strlen(tmp3->value)+strlen(tmp2->value)+strlen(s->name)+strlen(ext->value)+strlen(tmpI->name)+13)*sizeof(char));
     1902          sprintf(file_url,"%s/%s/%s_%s_%i.%s",tmp3->value,tmp2->value,s->name,tmpI->name,cpid+100000,ext->value);
     1903        }
    18961904        addToMap(tmpI->content,"Reference",file_url);
    18971905        if(hasExt!=true){
     
    25242532    addToCache(m,url,fcontent,fsize);
    25252533  free(fcontent);
    2526   free(cached);
     2534  if(cached!=NULL)
     2535    free(cached);
    25272536  return 0;
    25282537}
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