Ignore:
Timestamp:
Jul 10, 2019, 2:38:34 PM (5 years ago)
Author:
djay
Message:

Fix #172 and add the documentation on how to use the curl section to define cainfo.

File:
1 edited

Legend:

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

    r917 r944  
    8282{
    8383   size_t realsize = size * nmemb;
    84    int writen=0;
     84   size_t writen=0;
    8585   _HINTERNET *psInternet;
    8686   if(buffer==NULL){
     
    306306 */
    307307int AddMissingHeaderEntry(_HINTERNET* handle,const char* key,const char* value){
    308   int length=strlen(key)+strlen(value)+3;
     308  size_t length=strlen(key)+strlen(value)+3;
    309309  char *entry=(char*)malloc((length)*sizeof(char));
    310310  if(entry==NULL)
     
    326326        char *token, *saveptr;
    327327        int cnt;
    328         char* host;
    329328
    330329        // knut: make a copy of url since strtok family modifies first argument and cannot be used on constant strings 
     
    374373        token = strtok_r (tmp, ",", &saveptr);
    375374        while (token != NULL){
    376           int length=strlen(token)+6;
     375          size_t length=strlen(token)+6;
    377376          char* tmp1=(char*)malloc(length*sizeof(char));
    378377          map* tmpMap;
     
    414413      if(handle.hasCacheFile>0){
    415414        fclose(handle.file);
    416         unlink(handle.filename);
     415        zUnlink(handle.filename);
    417416        free(handle.filename);
    418417      }
     
    483482  hInternet->ihandle[hInternet->nb].id = hInternet->nb;
    484483  hInternet->ihandle[hInternet->nb].nDataAlloc = 0;
     484  hInternet->ihandle[hInternet->nb].code = -1;
    485485  hInternet->ihandle[hInternet->nb].pabyData = NULL;
    486486  hInternet->ihandle[hInternet->nb].post = NULL;
    487  
     487
     488  map* caBundle=getMapFromMaps((maps*) conf,"curl","cainfo");
     489  if(caBundle!=NULL)
     490    curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle,CURLOPT_CAINFO,caBundle->value);
    488491  curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle, CURLOPT_COOKIEFILE, "ALL");
    489492#ifndef TIGER
     
    626629    if(tmp!=NULL)
    627630      hInternet->ihandle[i].mimeType=zStrdup(tmp);
    628     curl_easy_getinfo(hInternet->ihandle[i].handle,CURLINFO_RESPONSE_CODE,&hInternet->ihandle[i].code);
     631    curl_easy_getinfo(hInternet->ihandle[i].handle,CURLINFO_RESPONSE_CODE,&(hInternet->ihandle[i].code));
    629632    curl_multi_remove_handle(hInternet->handle, hInternet->ihandle[i].handle);
    630633    curl_easy_cleanup(hInternet->ihandle[i].handle);
     
    658661 */
    659662int InternetReadFile(_HINTERNET hInternet,LPVOID lpBuffer,int dwNumberOfBytesToRead, size_t *lpdwNumberOfBytesRead){
    660   int dwDataSize;
     663  size_t dwDataSize;
    661664
    662665  if(hInternet.hasCacheFile>0){
     
    684687
    685688  if(hInternet.hasCacheFile>0){
    686     int freadRes = fread(lpBuffer,dwDataSize+1,1,hInternet.file);
     689    size_t freadRes = fread(lpBuffer,dwDataSize+1,1,hInternet.file);
    687690    *lpdwNumberOfBytesRead = hInternet.nDataLen;
    688691  }
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