Changeset 805 for trunk


Ignore:
Timestamp:
Jan 22, 2017, 5:32:02 PM (8 years ago)
Author:
djay
Message:

Return default iotype if no value has been provided. Fix potential segfault in case tmpIoType is null.

Location:
trunk/zoo-project/zoo-kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/configure.ac

    r804 r805  
    824824                OTB_RPATH="$OTBPATH/include/OTB-${OTBVERS}/"
    825825                OTB_CPPFLAGS="-I${OTB_RPATH}ApplicationEngine -I$OTB_RPATH/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTB_RPATH/Utilities/ITK -I$OTB_RPATH/ -I$OTB_RPATH/IO -I$OTB_RPATH/UtilitiesAdapters/OssimAdapters -I$OTB_RPATH/UtilitiesAdapters/CurlAdapters -I$OTB_RPATH/Utilities/BGL -I$OTB_RPATH/UtilitiesAdapters/ITKPendingPatches -I$OTB_RPATH/Utilities/otbconfigfile $GDAL_CFLAGS"
    826                 OTB_LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -lOTBImageIO-$OTBVERS -lOTBCommon-$OTBVERS -lOTBApplicationEngine-$OTBVERS -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS "
     826                OTB_LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -lOTBImageIO-$OTBVERS -lOTBCommon-$OTBVERS -lOTBApplicationEngine-$OTBVERS -L$ITKPATH/lib $ITK_LDFLAGS"
    827827        else
    828828                OTB_CPPFLAGS="-I$OTBPATH/include/otb/ApplicationEngine -I$OTBPATH/include/otb/Common -I$ITKPATH/include/ITK-$ITKVERS -I$OTBPATH/include/otb/Utilities/ITK -I$OTBPATH/include/otb/ -I$OTBPATH/include/otb/IO -I$OTBPATH/include/otb/UtilitiesAdapters/OssimAdapters -I$OTBPATH/include/otb/UtilitiesAdapters/CurlAdapters -I$OTBPATH/include/otb/Utilities/BGL -I$OTBPATH/include/otb/UtilitiesAdapters/ITKPendingPatches -I$OTBPATH/include/otb/Utilities/otbconfigfile $GDAL_CFLAGS"
    829                 OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib -lITKBiasCorrection-$ITKVERS -lITKCommon-$ITKVERS -lITKIOImageBase-$ITKVERS -lITKKLMRegionGrowing-$ITKVERS -lITKLabelMap-$ITKVERS -lITKMesh-$ITKVERS -lITKMetaIO-$ITKVERS -lITKOptimizers-$ITKVERS -lITKPath-$ITKVERS -lITKPolynomials-$ITKVERS -lITKQuadEdgeMesh-$ITKVERS -lITKSpatialObjects-$ITKVERS -lITKStatistics-$ITKVERS -lITKVNLInstantiation-$ITKVERS -lITKWatersheds-$ITKVERS -litkNetlibSlatec-$ITKVERS -litksys-$ITKVERS -litkdouble-conversion-$ITKVERS -litkv3p_lsqr-$ITKVERS -litkv3p_netlib-$ITKVERS -litkvcl-$ITKVERS -litkvnl-$ITKVERS -litkvnl_algo-$ITKVERS -litkzlib-$ITKVERS"
     829                OTB_LDFLAGS="-L$OTBPATH/lib/otb -lOTBIO -lOTBCommon -lOTBApplicationEngine -L$ITKPATH/lib $ITK_LDFLAGS"
    830830
    831831        fi
  • trunk/zoo-project/zoo-kernel/server_internal.c

    r798 r805  
    791791         * check for useMapServer presence
    792792         */
    793         map* tmpCheck=getMap(tmpIoType->content,"useMapServer");
    794         if(tmpCheck!=NULL){
    795           // Get the default value
    796           tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name,NULL);
    797           tmpCheck=getMap(tmpMaps->content,"mimeType");
    798           addToMap(tmpMaps->content,"requestedMimeType",tmpCheck->value);
    799           map* cursor=tmpIoType->content;
    800           while(cursor!=NULL){
    801             addToMap(tmpMaps->content,cursor->name,cursor->value);
    802             cursor=cursor->next;
    803           }
     793        if(tmpIoType!=NULL){
     794          map* tmpCheck=getMap(tmpIoType->content,"useMapServer");
     795          if(tmpCheck!=NULL){
     796            // Get the default value
     797            tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name,NULL);
     798            tmpCheck=getMap(tmpMaps->content,"mimeType");
     799            addToMap(tmpMaps->content,"requestedMimeType",tmpCheck->value);
     800            map* cursor=tmpIoType->content;
     801            while(cursor!=NULL){
     802              addToMap(tmpMaps->content,cursor->name,cursor->value);
     803              cursor=cursor->next;
     804            }
    804805         
    805           cursor=tmpInputs->content;
    806           while(cursor!=NULL){
    807             if(strcasecmp(cursor->name,"Title")==0 ||
    808                strcasecmp(cursor->name,"Abstract")==0)
    809               addToMap(tmpMaps->content,cursor->name,cursor->value);
    810            cursor=cursor->next;
     806            cursor=tmpInputs->content;
     807            while(cursor!=NULL){
     808              if(strcasecmp(cursor->name,"Title")==0 ||
     809                 strcasecmp(cursor->name,"Abstract")==0)
     810                addToMap(tmpMaps->content,cursor->name,cursor->value);
     811              cursor=cursor->next;
     812            }
    811813          }
    812814        }
  • trunk/zoo-project/zoo-kernel/service.c

    r794 r805  
    635635iotype* getIoTypeFromElement(elements* e,char *name, map* values){
    636636  elements* cursor=e;
    637   if(values!=NULL)
     637  if(values!=NULL){
    638638    while(cursor!=NULL){
    639639      if(strcasecmp(cursor->name,name)==0 && (cursor->defaults!=NULL || cursor->supported!=NULL)){
     
    651651      cursor=cursor->next;
    652652    }
     653  }else{
     654    while(cursor!=NULL){
     655      if(strcasecmp(cursor->name,name)==0 && cursor->defaults!=NULL){
     656        return cursor->defaults;
     657      }
     658      cursor=cursor->next;
     659    }
     660  }
    653661  return NULL;
    654662}
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