Ignore:
Timestamp:
May 4, 2019, 5:54:29 PM (5 years ago)
Author:
djay
Message:

Fixx issue in server_internal.c

File:
1 edited

Legend:

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

    r909 r910  
    379379  rewind(file);
    380380  if(getMap(content,"storage")==NULL){
    381     map* tmpMap1=getMap(content,"value");
    382     if(tmpMap1==NULL){
    383       addToMap(content,"value","");
    384       tmpMap1=getMap(content,"value");
    385     }
    386     free(tmpMap1->value);
    387     tmpMap1->value=(char*) malloc((count+1)*sizeof(char));
    388     if(tmpMap1->value==NULL){
    389       setMapInMaps(m,"lenv","message","Unable to allocate the memory required to read the produced file.");
    390     }
    391     fread(tmpMap1->value,1,count,file);
    392     tmpMap1->value[count]=0;
     381    map* memUse=getMapFromMaps(m,"main","memory");
     382    if(memUse==NULL || strncmp(memUse->value,"load",4)==0){
     383      map* tmpMap1=getMap(content,"value");
     384      if(tmpMap1==NULL){
     385        addToMap(content,"value","");
     386        tmpMap1=getMap(content,"value");
     387      }
     388      free(tmpMap1->value);
     389      tmpMap1->value=(char*) malloc((f_status.st_size+1)*sizeof(char));
     390      if(tmpMap1->value==NULL){
     391        setMapInMaps(m,"lenv","message","Unable to allocate the memory required to read the produced file.");
     392      }
     393      fread(&tmpMap1->value,1,f_status.st_size,file);
     394      tmpMap1->value[f_status.st_size]=0;
     395    }
    393396  }
    394397  fclose(file); 
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