Ignore:
Timestamp:
Oct 7, 2015, 8:41:43 AM (9 years ago)
Author:
david
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PublicaMundi_David_integration_01-devel/zoo-project/zoo-kernel/caching.c

    r642 r741  
    215215            fcontent=(char*)malloc((hInternet->ihandle[index].nDataLen+1)*sizeof(char));
    216216            if(fcontent == NULL){
    217               return errorException(*m, _("Unable to allocate memory."), "InternalError",NULL);
     217              return errorException(*m, _("Unable to allocate memory."), "InternalError",NULL,NULL);
    218218            }
    219219            size_t dwRead;
     
    233233            tmpMap->value=(char*)malloc((fsize+1)*sizeof(char));
    234234            if(tmpMap->value==NULL){
    235               return errorException(*m, _("Unable to allocate memory."), "InternalError",NULL);
     235              return errorException(*m, _("Unable to allocate memory."), "InternalError",NULL,NULL);
    236236            }
    237237            memcpy(tmpMap->value,fcontent,(fsize+1)*sizeof(char));
     
    277277void addRequestToQueue(maps** m,HINTERNET* hInternet,const char* url,bool req){
    278278  hInternet->waitingRequests[hInternet->nb]=strdup(url);
    279   hInternet->ihandle[hInternet->nb].header=NULL;
     279  //hInternet->ihandle[hInternet->nb].header=NULL;
    280280  if(req)
    281281    InternetOpenUrl(hInternet,hInternet->waitingRequests[hInternet->nb],NULL,0,INTERNET_FLAG_NO_CACHE_WRITE,0);
     
    304304 */
    305305int loadRemoteFile(maps** m,map** content,HINTERNET* hInternet,char *url){
    306   char* fcontent;
     306  char* fcontent = NULL;
    307307  char* cached=isInCache(*m,url);
    308308  char *mimeType=NULL;
     
    338338    }
    339339
    340   }else{   
     340  }else{
    341341    addRequestToQueue(m,hInternet,url,true);
    342342    return 0;
    343343  }
    344344  if(fsize==0){
    345     return errorException(*m, _("Unable to download the file."), "InternalError",NULL);
     345    return errorException(*m, _("Unable to download the file."), "InternalError",NULL,NULL);
    346346  }
    347347  if(mimeType!=NULL){
     
    354354
    355355  tmpMap->value=(char*)malloc((fsize+1)*sizeof(char));
    356   if(tmpMap->value==NULL)
    357     return errorException(*m, _("Unable to allocate memory."), "InternalError",NULL);
     356 
     357 if(tmpMap->value==NULL || fcontent == NULL)
     358    return errorException(*m, _("Unable to allocate memory"), "InternalError",NULL,NULL);
    358359  memcpy(tmpMap->value,fcontent,(fsize+1)*sizeof(char));
     360
     361 
     362 
     363 
     364  //if(tmpMap->value==NULL)
     365    //return errorException(*m, _("Unable to allocate memory."), "InternalError",NULL,NULL);
     366  //memcpy(tmpMap->value,fcontent,(fsize+1)*sizeof(char));
    359367
    360368  char ltmp1[256];
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