Ignore:
Timestamp:
Jan 9, 2019, 4:11:59 PM (5 years ago)
Author:
djay
Message:

Make this ZOO-Kernel working properly on windows platform again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/ulinet.c

    r871 r890  
    238238  HINTERNET ret;
    239239  ret.handle=curl_multi_init();
    240   ret.agent=strdup(lpszAgent);
     240  ret.agent=zStrdup(lpszAgent);
    241241  ret.nb=0;
    242242  ret.waitingRequests[ret.nb] = NULL;
     
    269269char* getProvenance(maps* conf,const char* url){
    270270  map* sharedCache=getMapFromMaps(conf,"security","shared");
     271  char *res="OTHER";
     272  char *paths[2]={
     273    "mapserverAddress",
     274    "tmpUrl"
     275  };
    271276  if(sharedCache!=NULL){
    272     char *res=NULL;
    273277    char *hosts=sharedCache->value;
    274278    char *curs=strtok(hosts,",");
    275279    while(curs!=NULL){
    276       if(strstr(url,curs)==NULL)
    277         res="OTHER";
    278       else{
    279         res="SHARED";
    280         return res;
     280      if(strstr(url,curs)==NULL){
     281        return "SHARED";
    281282      }
    282283      curs=strtok(NULL,",");
    283284    }
    284     return res;
    285   }
    286   return "OTHER";
     285  }
     286  for(int i=0;i<2;i++){
     287    sharedCache=getMapFromMaps(conf,"main",paths[i]);
     288    if(sharedCache!=NULL){
     289      if(strstr(url,sharedCache->value)!=NULL){
     290        return "LOCAL";
     291      }
     292    }
     293  }
     294  return res;
    287295}
    288296
     
    482490#endif
    483491
    484   if(memUse!=NULL && strcasecmp(memUse->value,"load")==0)
     492  if(memUse==NULL || strcasecmp(memuse->value,"load")==0)
    485493    ldwFlags=INTERNET_FLAG_NO_CACHE_WRITE;
    486494 
     
    502510        sprintf(filename,"/tmp/ZOO_Cache%s", tmpUuid);
    503511      else
    504         sprintf(filename,"/%s/ZOO_Cache%s", tmpPath->value,tmpUuid);
     512        sprintf(filename,"%s/ZOO_Cache%s", tmpPath->value,tmpUuid);
    505513      free(tmpUuid);
    506       hInternet->ihandle[hInternet->nb].filename=strdup(filename);
     514      hInternet->ihandle[hInternet->nb].filename=zStrdup(filename);
    507515      hInternet->ihandle[hInternet->nb].file=fopen(hInternet->ihandle[hInternet->nb].filename,"w+");
    508516      hInternet->ihandle[hInternet->nb].hasCacheFile=1;
     
    524532    curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_VERBOSE,1);
    525533#endif
    526     hInternet->ihandle[hInternet->nb].post=strdup(lpszHeaders);
     534    hInternet->ihandle[hInternet->nb].post=zStrdup(lpszHeaders);
    527535    curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_POSTFIELDS,hInternet->ihandle[hInternet->nb].post);
    528536    curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_POSTFIELDSIZE,(long)dwHeadersLength);
     
    602610    curl_easy_getinfo(hInternet->ihandle[i].handle,CURLINFO_CONTENT_TYPE,&tmp);
    603611    if(tmp!=NULL)
    604       hInternet->ihandle[i].mimeType=strdup(tmp);
     612      hInternet->ihandle[i].mimeType=zStrdup(tmp);
    605613    curl_easy_getinfo(hInternet->ihandle[i].handle,CURLINFO_RESPONSE_CODE,&hInternet->ihandle[i].code);
    606614    curl_multi_remove_handle(hInternet->handle, hInternet->ihandle[i].handle);
     
    618626 */
    619627int freeCookieList(HINTERNET hInternet){
    620   hInternet.ihandle[hInternet.nb].cookie=strdup("");
     628  hInternet.ihandle[hInternet.nb].cookie=zStrdup("");
    621629#ifndef TIGER
    622630  curl_easy_setopt(hInternet.ihandle[hInternet.nb].handle, CURLOPT_COOKIELIST, "ALL");
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