Changeset 890 for branches/prototype-v0/zoo-project/zoo-kernel/ulinet.c
- Timestamp:
- Jan 9, 2019, 4:11:59 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/ulinet.c
r871 r890 238 238 HINTERNET ret; 239 239 ret.handle=curl_multi_init(); 240 ret.agent= strdup(lpszAgent);240 ret.agent=zStrdup(lpszAgent); 241 241 ret.nb=0; 242 242 ret.waitingRequests[ret.nb] = NULL; … … 269 269 char* getProvenance(maps* conf,const char* url){ 270 270 map* sharedCache=getMapFromMaps(conf,"security","shared"); 271 char *res="OTHER"; 272 char *paths[2]={ 273 "mapserverAddress", 274 "tmpUrl" 275 }; 271 276 if(sharedCache!=NULL){ 272 char *res=NULL;273 277 char *hosts=sharedCache->value; 274 278 char *curs=strtok(hosts,","); 275 279 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"; 281 282 } 282 283 curs=strtok(NULL,","); 283 284 } 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; 287 295 } 288 296 … … 482 490 #endif 483 491 484 if(memUse !=NULL && strcasecmp(memUse->value,"load")==0)492 if(memUse==NULL || strcasecmp(memuse->value,"load")==0) 485 493 ldwFlags=INTERNET_FLAG_NO_CACHE_WRITE; 486 494 … … 502 510 sprintf(filename,"/tmp/ZOO_Cache%s", tmpUuid); 503 511 else 504 sprintf(filename," /%s/ZOO_Cache%s", tmpPath->value,tmpUuid);512 sprintf(filename,"%s/ZOO_Cache%s", tmpPath->value,tmpUuid); 505 513 free(tmpUuid); 506 hInternet->ihandle[hInternet->nb].filename= strdup(filename);514 hInternet->ihandle[hInternet->nb].filename=zStrdup(filename); 507 515 hInternet->ihandle[hInternet->nb].file=fopen(hInternet->ihandle[hInternet->nb].filename,"w+"); 508 516 hInternet->ihandle[hInternet->nb].hasCacheFile=1; … … 524 532 curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_VERBOSE,1); 525 533 #endif 526 hInternet->ihandle[hInternet->nb].post= strdup(lpszHeaders);534 hInternet->ihandle[hInternet->nb].post=zStrdup(lpszHeaders); 527 535 curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_POSTFIELDS,hInternet->ihandle[hInternet->nb].post); 528 536 curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_POSTFIELDSIZE,(long)dwHeadersLength); … … 602 610 curl_easy_getinfo(hInternet->ihandle[i].handle,CURLINFO_CONTENT_TYPE,&tmp); 603 611 if(tmp!=NULL) 604 hInternet->ihandle[i].mimeType= strdup(tmp);612 hInternet->ihandle[i].mimeType=zStrdup(tmp); 605 613 curl_easy_getinfo(hInternet->ihandle[i].handle,CURLINFO_RESPONSE_CODE,&hInternet->ihandle[i].code); 606 614 curl_multi_remove_handle(hInternet->handle, hInternet->ihandle[i].handle); … … 618 626 */ 619 627 int freeCookieList(HINTERNET hInternet){ 620 hInternet.ihandle[hInternet.nb].cookie= strdup("");628 hInternet.ihandle[hInternet.nb].cookie=zStrdup(""); 621 629 #ifndef TIGER 622 630 curl_easy_setopt(hInternet.ihandle[hInternet.nb].handle, CURLOPT_COOKIELIST, "ALL");
Note: See TracChangeset
for help on using the changeset viewer.