- Timestamp:
- Oct 7, 2015, 8:41:43 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PublicaMundi_David_integration_01-devel/zoo-project/zoo-kernel/caching.c
r642 r741 215 215 fcontent=(char*)malloc((hInternet->ihandle[index].nDataLen+1)*sizeof(char)); 216 216 if(fcontent == NULL){ 217 return errorException(*m, _("Unable to allocate memory."), "InternalError",NULL );217 return errorException(*m, _("Unable to allocate memory."), "InternalError",NULL,NULL); 218 218 } 219 219 size_t dwRead; … … 233 233 tmpMap->value=(char*)malloc((fsize+1)*sizeof(char)); 234 234 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); 236 236 } 237 237 memcpy(tmpMap->value,fcontent,(fsize+1)*sizeof(char)); … … 277 277 void addRequestToQueue(maps** m,HINTERNET* hInternet,const char* url,bool req){ 278 278 hInternet->waitingRequests[hInternet->nb]=strdup(url); 279 hInternet->ihandle[hInternet->nb].header=NULL;279 //hInternet->ihandle[hInternet->nb].header=NULL; 280 280 if(req) 281 281 InternetOpenUrl(hInternet,hInternet->waitingRequests[hInternet->nb],NULL,0,INTERNET_FLAG_NO_CACHE_WRITE,0); … … 304 304 */ 305 305 int loadRemoteFile(maps** m,map** content,HINTERNET* hInternet,char *url){ 306 char* fcontent ;306 char* fcontent = NULL; 307 307 char* cached=isInCache(*m,url); 308 308 char *mimeType=NULL; … … 338 338 } 339 339 340 }else{ 340 }else{ 341 341 addRequestToQueue(m,hInternet,url,true); 342 342 return 0; 343 343 } 344 344 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); 346 346 } 347 347 if(mimeType!=NULL){ … … 354 354 355 355 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); 358 359 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)); 359 367 360 368 char ltmp1[256];
Note: See TracChangeset
for help on using the changeset viewer.